October 4, 200124 yr I am trying to allow an office staff to enter codes throughout the day, and run a script at the end of the day that prints out letters to be sent. For example, in the field "code" the number "1" would print out a letter confirming an appointment date and time for a patient. The number "2" might print a letter to a patient that missed an appointment. The script I wrote is as follows. find all enter find mode insert text (specify "code" field)>0 Perform find loop if "code = "1"" go to layout "confirm appointment" Print (no dialogue) Else if "code = "2"" go to layout "missed appointment" Print (no dialogue) Go to record Next end loop end if end if The end result is not what I want? I expected to get letters to patients with new appointment, and different letters to different patients who missed appointment. I am getting multiple copies of the same letter to the same patient as if my loop or my "if" statement is not working. Any advice would be appreciated.
October 4, 200124 yr Your If's are inside the loop and the End If's are outside the loop. You need to have your end loop after the last End If. For the sake of efficiency, why not do a find for code = 1 and print all those letters at once. Then, do a find code=2 and print all those letters. Then you don't need any If's or loops.
Create an account or sign in to comment