field automatically fill in from field on other form

laurat

Registered User.
Local time
Today, 11:55
Joined
Mar 21, 2002
Messages
120
There is a field on a form that I would like to carry over onto another form. Let's see if I can explain this. The user opens the form and fills in all the date. Then I have another form (based off of a different table than the first form, both tables have the same field for the primary key), when they type in the number in the primary key field I would like one of the fields to automatically fill in with data from another field on the other form. Is there a way to do this??
 
You could pass the data via the OpenArgs argument of the OpenForm method. Or you can use code similar to this in the second forms On Open event:

Me.FieldToFillIn = [Forms]![FirstFormsName]![FieldWithData]

The first form must remain open for the above to work.

You could also set a global variable when you enter the data into the first form and then use the variable in the On Open event of the second form instead of using OpenArgs.

hth,
Jack
 
"You could also set a global variable when you enter the data into the first form and then use the variable in the On Open event of the second form instead of using OpenArgs. "

Could explain this approach to me a little more. Does the form have to be open? What code do I use? Thanks!!
 
More info on that suggested approach?? I don't understand it exactly
 

Users who are viewing this thread

Back
Top Bottom