Jump to content
Sign in to follow this  
PDoctor

Cant manage relationships

Recommended Posts

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

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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 by LaRetta

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.