Newbies PDoctor Posted December 7, 2014 Newbies Share Posted December 7, 2014 Hi, am trying to move from Access to FM.(And I'm a painful beginner) I have 2 tables: 1 with PatientDetails (mother table) and the other with VisitDetails (child table). While the AutoSerial no with a +1 increment works for all new Patients, I'd like to know to lookup existing patients and add a unique serial no for each visit, while maintaining the PatientID (which defines the relationship between the 2 tables). Is there any way of automating this.... With Access this was a no-brainer.... Thanks Link to comment Share on other sites More sharing options...
Wim Decorte Posted December 7, 2014 Share Posted December 7, 2014 Welcome to FileMaker! The VisitDetails table needs to have its own auto-increment primary key of course. Are you struggling with populating the patient ID foreign key in the VisitDetail table? Provided that you have a relationship already set up between patients and visit details on patient ID in both tables: If you add visit details in a portal you can use the "allow creation of related records" on the visit detail side to auto-populate the patient ID in visit details. Or you can just script the creation of a new visit detail record (the preferred way since you can vet the data before creating a new visit detail record). Link to comment Share on other sites More sharing options...
LaRetta Posted December 7, 2014 Share Posted December 7, 2014 (edited) I had just created this so I'll go ahead and post it! Hi PDoctor! On Visits layout, you can select a Patient from the blue popup. Or you can go to the Patients table and add visits directly by typing a date into the first empty row in the portal. This is specified by checking 'allow creation' in the relationship graph. File attached A scripted creation of child (visit) records would look something like this - when fired from Patient layout: Freeze Window Set Variable [ $patientID ; ID ] Go To Layout [ data-entry layout based upon Visits ] New Record/Request Set Field [ Visits::PatientID ; $patientID ] Hi Wim! :-) Patients.fmp12.zip Edited December 7, 2014 by LaRetta Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3428 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