passing a value from one form to another form

hyousef

Registered User.
Local time
Today, 19:57
Joined
Jan 15, 2002
Messages
41
I have a form that contains several text boxes, one of the text boxes is a "project Number", for example, the project number for the first record is "P14X" and the project number for the second record is "P14XZ" and so on..
Lets say i am viewing "record 1" and the project number is "P14X"...what i want is when i click "open" button to open another form pass this project number "P14X" that i am currently viewing to a second form, so it will be automatically entered in a field in the second form.
How can i do that?
Thanks in advance.
 
Pass the value of your pk on your first form to the second using the OpenArgs of the open form action.

DoCmd.OpenForm "frmForm2",,,Me.Proj#FieldName

On the OnOpen event of the other form:

If Not IsNull (Me.OpenArgs) Then
Me.Proj#FieldNameField = Me.OpenArgs
Exit Sub
End If
 
Thanks Jwindon it works,
redface.gif
)
 

Users who are viewing this thread

Back
Top Bottom