linking subform to mainform field

P

Pearl

I have a main form that has a field called LastName. I also have a subform
that also has a field called LastName. I placed that field in the subform to
be able to correlate the subform to the mainform BUT what I want is that each
time I open the form to a specific LastName in the main form that the subform
field called LastName will auto populate with the same value in the mainform
field called LastName. How do I do this? I have done this a long time ago
but can not remember how I did this. I recall I did this completely using
the Build option in properties of the field and did not use VBA ( I am not
versed in VBA and would prefer to not do this in VBA). Can anyone assist?
 
J

John Vinson

I have a main form that has a field called LastName. I also have a subform
that also has a field called LastName. I placed that field in the subform to
be able to correlate the subform to the mainform BUT what I want is that each
time I open the form to a specific LastName in the main form that the subform
field called LastName will auto populate with the same value in the mainform
field called LastName. How do I do this? I have done this a long time ago
but can not remember how I did this. I recall I did this completely using
the Build option in properties of the field and did not use VBA ( I am not
versed in VBA and would prefer to not do this in VBA). Can anyone assist?

I see Sprinks has provided you with the answer (thanks!) but let me
just amplify on one point he made.

Names ARE NOT UNIQUE.

If you have eleven different people all named Smith in your database,
and seven named Brown, which person's data do you want to see on the
subform?

Or do you tell the second Smith "I'm sorry, we can't do business with
you, there's already someone named Smith in our database?"

Use a unique PersonID instead; and as Sprinks says, there's probably
no good reason to display the same name on both the form and the
subform.

John W. Vinson[MVP]
 
Top