passing data from a form to another form

smelly

Registered User.
Local time
Today, 15:47
Joined
May 23, 2002
Messages
44
I am trying to pass a project number from form A to form B. I have a button which opens form B with a procedure as follows......

Private Sub Send_Number_Click()
stLinkCriteria = "[ProjectNumber]=" & Me![ProjectNumber]
DoCmd.OpenForm "Practice2", , , stLinkCriteria
End Sub

but this is giving me an error message that
"Object does not support this object or method"

Please help! Thanks in advance for your time.
 
S,

Test the following by putting a command button on the practice1 form and assigning this code to its click event.

Private Sub Button_Click()

Dim PNum As Long
' TxtProjectNumber is a text field on Practice1 form
PNum = Me.txtProjectNumber

DoCmd.OpenForm "Practice2"

' TxtProjectNumber2 is a text field on Practice2 form
[Forms]![Practice2].TxtProjectNumber2 = PNum

End Sub

Regards,
Tim
 
Thank you but I am still gettting an error message. I am very inexperienced with this and will keep trying to figure out where the error is coming from.
Thanks!
 
Yes!!!!! Thank you it worked. The error was from my table but the code is working!
 

Users who are viewing this thread

Back
Top Bottom