1 Reply Latest reply on Aug 26, 2009 8:53 AM by philmodjunk

    Related layouts



      Related layouts


      Hi, I'm trying to  create a relation between two tables, or layouts, in a database for medical records. One of them (PATIENTS) stores personal data, and the second one (VISITS) is designed to store clinical data from the current visit, including some of the personal data (i.e., first and lastname, age, and so) which must be taken through a relation. This one is built with an ID numeric field in both tables, being a one (PATIENTS) to many (VISITS) relation, but I have troubles defining it, because while the ID field in the PATIENTS layout is a numeric one of auto sequential introduction, the ID numeric field in the VISITS layout should take it content from the ID field of the PATIENTS layout (or PATIENTS::ID), storing automatically the same patient number ID in every different visit (one to many), but I can't see the the way to get it. Thanks in advance.

        • 1. Re: Related layouts

          Tables and layouts are two different things. In filemaker you build relationships between tables not layouts. However, each layout is based on a table, so the relationships that link each table will in turn help control how the data from each table is displayed on your layouts.


          First thing you'll want to read about in the help files are "Portals". Portals give you a window that allows you to list data fron a different table that is related to the current record. Thus, you can set up a layout based on your patient table and then add a portal that lists related visit records. The help file will take you step by step through this process, so try that and then post any questions/problems back here and we'll see what we can do to help.


          Second thing you'll need to do is to create a relationship linking your two tables that allows you to use the relationship to create records in the Visits table.


          Open File | Manage | Database | Relationship

          If you haven't already done so, click and drag to create a relationship linking the Patients::ID to Visits::ID.

          Double click this relationship line and select the check box labeled "Allow creation of records in this table via this relationship" for the Visit table.


          Now you can create a portal that displays Vist records for a given patient and when you start entering data in the bottom blank line of the portal, the Visits::ID field will automatically get the Patients::ID number of the current record.