Thanks I tried both ideas and they work but don't give me the effect I want.
I would really like a form that pops up off the current form.
When I use a command button to popup a form based on a related table I get
an error about no related record in the master table. This leads me to
beleive that if I can retrieve the primary key from the current record in the
parent form, then use that for the default value of the key in the child form
all will be well. How can I do that?
It's a bit more work but it's doable.
In the OpenForm code, pass the current form's linking field (the
equivalent of a subform's Master Link Field) in the OpenArgs argument;
also pass a WhereCondition to display only the related records in the
WhereCondition argument. E.g.
DoCmd.OpenForm strFormName, _
WhereCondition := "[ForeignKey] = " & Me!txtPrimaryKey, _
OpenArgs := Me!txtPrimaryKey
Then in the Form's Open event set the default value of the foreign key
field to the OpenArgs argument:
Me.txtForeignKey.DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
John W. Vinson[MVP]