Opening a form within a form

M

Mal

I have a form (A) and in that form I want to have a control that will open a
data entry form(B). Every time I try code or a macro it takes me back to my
first record on the data entry form no matter what record I am on in form (A).
I cannot get these 2 forms to be linked together. The info in both forms are
in the same table.
Please help me. I am new to this coding thing so simple is good.

Thank You in adavance
Mal
 
C

Carl Rapson

Are you using the DoCmd.OpenForm command to open your data entry form? If
so, add a string to the WhereCondition parameter of the OpenForm call,
something like:

DoCmd.OpenForm "B", , , "[ID]=" & Me.ID

Where [ID] is the primary key field in your table and Me.ID refers to that
field's value on form A. That should restrict the records that form B sees
to only that one with the current ID value.

Carl Rapson
 
Top