Link new record to existing form

microsoft access

In Access 2007. We enter a new record on a form. Then we click a button which has a macro action to open another form. What can I do to make the new form open but linked to the new record? I understand that I need the primary key on the new form etc. If the record was saved I can make the second form open with that data. But My Question is when it's still a new record/form we need to navigate directly onto the linked form…

Please share some direction on this..

Best Answer

If the records are related in a parent/child relationship, the usual architecture is to use a subform embedded in the main form, instead of opening up a popup form.

If you insist on the popup form, you could use the DoCmd.OpenForm's OpenArgs argument to pass a value to the popup form. But I consider that bad design form something like this -- the parent/child relationship is better represented with a main form/subform, which means you don't have to pass any information, as the LinkChild/LinkMaster properties take care of the linking data, and the two forms can see each other's data quite easily and reliably.

Related Question