I am new to FMP and databases in general. Have a database with two tables. One contains info on people (names, etc.). Second has questionnaire answered by those people. I have 17 layouts. 1 has info on people. Other 16 are pages of the questionnaire and also include person's name and id number. Would like to set it up so that when I create a record and enter in the person's data on layout 1, it will create a record for each page of the questionnaire and will enter in the person's name on each page. Any thoughts? Thanks,Ashley
With 17 layouts you won't be new to databases for long! :smileywink:
It sounds like you have 16 layouts that use different fields from the same Questionnaire table (let's call it Questions). I'm guessing you could greatly simplify this initial setup by redesigning your Questions table and then merging these 16 layouts into a single scrolling layout.
Regardless of whether you take that advice, here's the answer to your specific question.
Create a relationship linking People to Questions.
- Select File | Manage Database | Fields
- You need an ID number in your Questions database as well as in your People table.
- If you haven't already done so, Define this field.
- If you haven't already set up your ID field in People to be an auto-enter serial number. Do so.
- Click the Relationships tag.
- Drag from the ID field in one table to the ID field in the other. This creates a line that links your two tables.
- Double click this line to bring up the Relationship Dialog and click the "All creation of records in this table..." check box on the Questions side of the Relationship.
- Click Ok twice to get back to your layouts.
Enable the user to select a specific person from the People table
I'll describe a simple method for a single question layout. If you stick with your 16 layouts you'll need to do this for each layout, that's why I recommend changing your design.
- Enter layout mode and select Layouts | Layout setup...
- Change the table listed in this layout from Questions to People and click OK.
- Place the ID and name fields somewhere useful on this layout.
- Return to Browse mode, saving your changes.
Now if you enter an ID code for a existing person, you should see their questions and the person's name in the name field.
If you create a new record, you can enter the person's name and record answers to your questions. Their Id number should appear automatically.
Get this part working for you and post back for how to add a method for selecting a People record that's more user friendly than entering their ID number.