Hi, I have two tables, one called Deliverables and the other called TestScenarios. They are linked in a
one-to-many relationship, with Deliverables being on the "one" side of the relationship. I also have a form corresponding to each table, called frmDeliverables and frmTestScenarios recpectively.
Because frmDeliverables is a subform of another form, and there is limited screen real estate, I created a button on frmDeliverables that pops up frmTestScenarios such that the latter is filtered to display only the records in the TestScenarios table that are related to the current record shown in frmDeliverables.
This works fine until I try to add a new record in the frmTestScenarios form. At this point, all the fields, including the foreign key field which links the record in frmTestScenarios to the one in frmDeliverables, are set to nothing. Ideally I would like the foreign key field to be hidden. Is there a way to set the value of the foreign key field in frmTestScenarios to the primary key of the record shown in frmDeliverables, whenever a new record is created in frmTestScenarios?
Thanks a lot!
one-to-many relationship, with Deliverables being on the "one" side of the relationship. I also have a form corresponding to each table, called frmDeliverables and frmTestScenarios recpectively.
Because frmDeliverables is a subform of another form, and there is limited screen real estate, I created a button on frmDeliverables that pops up frmTestScenarios such that the latter is filtered to display only the records in the TestScenarios table that are related to the current record shown in frmDeliverables.
This works fine until I try to add a new record in the frmTestScenarios form. At this point, all the fields, including the foreign key field which links the record in frmTestScenarios to the one in frmDeliverables, are set to nothing. Ideally I would like the foreign key field to be hidden. Is there a way to set the value of the foreign key field in frmTestScenarios to the primary key of the record shown in frmDeliverables, whenever a new record is created in frmTestScenarios?
Thanks a lot!