The easiest way to do this is to use a subform on your form that is the fmRE. Bind it using the stStuID field. This will display the records for students who have them and a blank record where there is no record available.
If you try to open another form you will have problems with the ones that haven't any records. For future reference the code would be:
DoCmd.OpenForm "fmRE", , , "[stStuID]=" & Me.stStuID
Quote:
Originally Posted by cmp80
I have a database that I am using to store student data. There are two tables and two forms to display the data:
Tables
tbStudent
tbRE
Forms
fmStudent
fmRE
tbStudent stores basic student data, while tbRE stores specific academic data for some, but not all, students. The two tables are linked through the student ID number(stStuID), which is the key in tbStudent.
I would like to create a command button in fmStudent that opens fmRE, but to the record of the student currently displayed in fmStudent. Aside from opening fmRE to a specific record, I am also curious about what happens if a student does not have a record in fmRE. Could I have the command open fmRE to a blank record if the student doesn't have a record, so the user can enter the data to create one?
I have not used VBA very much so I am new to this level of design. I've seen some responses to this type of question, but I'm not sure how to get started with the coding.
I am using Access 2003 on Windows XP.
Thanks!