December 7, 201411 yr Newbies 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
December 7, 201411 yr 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).
December 7, 201411 yr 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, 201411 yr by LaRetta
Create an account or sign in to comment