Newbies tlhooper Posted September 11, 2013 Newbies Posted September 11, 2013 I am trying to use a FM database to record the responses of study participants to a series of surveys. They will complete the studies on an iPad using FM Go. I have created a table for Subjects and separate tables for each survey. I want to create a relationship between the subject and each survey, and I've set up these relationships using the SubjectID as the primary key in the Subject table and foreign keys in each survey table. Participants will first complete the subject table then go to another layout for the first survey. My problem is that I cannot figure out how to automatically relate the SubjectID to the new survey layout. I can do it using a pop-up menu, having the subject select the proper subject number, but I want this field to be automatically populated with the proper subject ID number. Can somebody please help a FM newbie? Thanks!
doughemi Posted September 12, 2013 Posted September 12, 2013 Assuming that the user clicks a button to go to the survey, attach a script to the button: Set Variable[$$SubjID; SubjectNumber] Go to Layout["YourSurveyLayout"] New Record/Request Set Field[YourFKfield; $$SubjID] I chose to use a global variable ($$) because if the user goes to another survey in the same session, the number will still be stored. If the user always goes back to the Subject table before starting a new survey, then you could use a script variable ($)
Recommended Posts
This topic is 4151 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