BruceJ Posted January 25, 2006 Posted January 25, 2006 I have a solution that needs to auto-fill certain fields. For example - a medical record: The first visit a patient answers YES to a question about smoking. Then several months latter the patient returns and the same assessment is completed, the smoking field defaults (look up) and fill in YES in the smoking field, but then the patient says they stopped smoking so it needs to be changed to NO. Then several months latter, same patient returns, same assessment, and NO is now the default (look up) for this question. I've got lots instances of this type of issue... does anyone have a simple, straight forward solution.
comment Posted January 25, 2006 Posted January 25, 2006 Make a selfjoin: Form::PatientID = Form 2::PatientID AND Form::SerialID > Form 2::SerialID Sort the relationship on Form 2 side by SerialID, descending. Now the first related record is the previous form filled out for this patient.
BruceJ Posted January 25, 2006 Author Posted January 25, 2006 Make a selfjoin: Form::PatientID = Form 2::PatientID AND Form::SerialID > Form 2::SerialID Sort the relationship on Form 2 side by SerialID, descending. Now the first related record is the previous form filled out for this patient. When I do this the look-up pulls form the first created related record reguardless of how I sort them. Am I doing something wrong?
BruceJ Posted January 26, 2006 Author Posted January 26, 2006 Yep - I was doing something wrong! The sort has to be specified in the relationship definition. I was just going to the layout and doing a sort. Man! This is a lifesaver - you can't imagine! Many thanks!
Recommended Posts
This topic is 6940 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now