June 11, 200421 yr Hi, I'm a newbie trying to make a script and, after a few days of messing with it, am in need of some help. I'm making a Medical Record script for my summer camp kids which has 3 tables. Demographics, Encounters, and Medications log. My script uses the patients name as the constraining information and goes to each table, looks for the patient, and then prints the data. What I should end up with is the demographics cover sheet showing name, age, etc.; a list of all meds I've given and a list of all encounters. It works fine if the patient has atleast one record in each table, but if they don't, it goes back to the last table and prints it again. So, I start with demographics, it find the patient, prints all their background info, then it looks for encounters, doesn't find any, returns to demographics, and prints the form again. I'd like it to just print an encounter list with no records and move on. Sorry for the long winded explanation, I don't have the FM lingo down quite yet. Randall
June 11, 200421 yr Randall: Welcome to the Forums. You need to put Set Error Caputure [on] before each find, then check to see if there is a found item before you print, so each Print statement would be within an If statement: If [Get(FoundCount)>0] Print[] End If What's happening currently is that you're getting no found set, then the Print statement kicks in, and it just prints whatever it sees... -Stanley
June 12, 200421 yr Author Thanks for the quick response! The script works but too late. As soon as it realizes that there are no records matching the search it goes right back to the original layout which, of coures, has a find value of >0 so it prints it.
June 12, 200421 yr Using If [not IsEmpty( Encounters::serial )] Go to Related Record [show, Encounters] Perform Script [External, Print] End If from the Demographics file would prevent even going to the Encounters file if there are no related records. And a find isn't necessary if you have a valid relationship.
Create an account or sign in to comment