How do I get the master field to populate when adding a record?

M

Mandango

I have a command button to open a form and it is linked by one field. It is
pulling just the records that I want, but when I try to add a new record, it
does not populate the linked field like it does in a true subform.
 
J

John Vinson

I have a command button to open a form and it is linked by one field. It is
pulling just the records that I want, but when I try to add a new record, it
does not populate the linked field like it does in a true subform.

Well... that's because it's not a subform!

If you really need the separate popup form, pass the value of the
linking field in the Form's OpenArgs parameter. In the form's Open
event, set the DefaultValue property of the ID field to the OpenArgs
value.

John W. Vinson[MVP]
 
Top