Zydeceltico
Registered User.
- Local time
- Today, 18:07
- Joined
- Dec 5, 2017
- Messages
- 843
Hi All -
I have 2 tables: tblInspectionReport and tblMillInspect. They are linked by fields InspectionEvent_ID and InspectionEvent_FK respectively.
Report rptInspectionReport and qryInspectionEvent work exactly as expected and return exactly what I am looking for.
I have frmInspectionEvent based on the two tables - which again - are linked by fields InspectionEvent_ID and InspectionEvent_FK respectively. Subform sfrmMillInspect is embedded in frmInspectionEvent.
InspectionEvent_ID in tblInspectionEvent is autonumber.
What I don't know how to handle is the relationship between InspectionEvent_ID and InspectionEvent_FK from the main form to the subform.
When I open frmInspectionEvent and fill in the data in the main section of the form - after I have entered a value in the last available field the field bound to InspectionEvent_ID autopopulates in the main form but the corresponding field (InspectionEvent_FK) in the subform does not - which throws me an error message.
I can get around this if I manually enter the autonumbered value from InspectionEvent_ID in the main form into InspectionEvent_FK in the subform. But it seems inelegant. I'm sure there is a better way.
All fields are saved in both tables when I click the "Save Record" button in the main form - fwiw.
Thanks for the help!
Tim
I have 2 tables: tblInspectionReport and tblMillInspect. They are linked by fields InspectionEvent_ID and InspectionEvent_FK respectively.
Report rptInspectionReport and qryInspectionEvent work exactly as expected and return exactly what I am looking for.
I have frmInspectionEvent based on the two tables - which again - are linked by fields InspectionEvent_ID and InspectionEvent_FK respectively. Subform sfrmMillInspect is embedded in frmInspectionEvent.
InspectionEvent_ID in tblInspectionEvent is autonumber.
What I don't know how to handle is the relationship between InspectionEvent_ID and InspectionEvent_FK from the main form to the subform.
When I open frmInspectionEvent and fill in the data in the main section of the form - after I have entered a value in the last available field the field bound to InspectionEvent_ID autopopulates in the main form but the corresponding field (InspectionEvent_FK) in the subform does not - which throws me an error message.
I can get around this if I manually enter the autonumbered value from InspectionEvent_ID in the main form into InspectionEvent_FK in the subform. But it seems inelegant. I'm sure there is a better way.
All fields are saved in both tables when I click the "Save Record" button in the main form - fwiw.
Thanks for the help!
Tim