July 28, 200520 yr Newbies How do I get the loop, see below, to exit after it has checked the last record? I've tried doing the same thing with Next Record - Exit After Last, but the script exits after only one iteration. It doesn't continue even though I've checked Exit after Last. Loop If ["Contact = "N_A""] Set field ["Contact = "Not Applicable""] Else Omit Record End If End Loop
July 28, 200520 yr KKelly: Welcome to the Forums. The end of your script should be: End If Go To Record [next, exit after last] End Loop Also, you should put in Go To Record [First] before the beginning of your loop. -Stanley
July 28, 200520 yr Author Newbies thanks for the help. however, the script now seems to skip a record whenever Contact does not equal N_A, because it omits, ends the if, then goes to next without checking the one it's on.
July 28, 200520 yr Hi kkelly [color:red] Update your Profile to reflect the version of FileMaker, OS, and Platform you are using. Version 6 and 7: You can also just do a simple Find and Replace to accomplish this. Put your cursor in the Contact field, and then Go to Main Menu >> Edit >> Find/Replace. Find: N_A Replace Not Applicable Direction = [color:blue] All Search Across = [color:blue] All Records Search Within = [color:blue] Current field Or, Perform a Find in Contact field for "N_A" Go To Main Menu >> Records >> and Click on Specify and enter this calculation in the Box Substitute YourTextField; "N_A"; "Not Applicable") HTH Lee
July 28, 200520 yr I see it a bit differently ... in reverse actually (typical, huh?). You wish to end up with a set of "Not Applicable" records when finished setting them, right? And that's why you are Omitting? Try this: Go To Record/Request/Page [ First ] Go To Field [ anyField ] View As Form Freeze Window Loop If [ Contact <> "N_A" ] Omit Record End If Set Field [ Contact ; "Not Applicable" ] Go To Record/Request/Page [ Exit After Last; Next ] End Loop It appears to do what you wish and leave you with your proper found set of "Not Applicable." I added the View As Form, Freeze Window and Go To Field[] steps because they substantially speed up looping Set Field scripts in addition to claiming possession in multi-user.
July 28, 200520 yr Wholly cow, The way the site is acting today, everyone is responding to everyone else, and not the one they are directing their response to. Lee
July 29, 200520 yr The Go To Record [Next, Exit after last] step should actually be directly after the Set Field step in KKelly's original script. And LaRetta's should have an Else If, followed by the Set Field and GTRN steps, or it omits, sets the next record as "Not Applicable", without testing it, and then continues to the next record.
Create an account or sign in to comment