passed value is wrong number! (1 Viewer)

smelly

Registered User.
Local time
Today, 15:15
Joined
May 23, 2002
Messages
44
I am trying to pass a value but when the form opens it has the wrong value in the text box. When I open the form again the correct value is in the text box. Does anyone know what is going on?
Here is my code...
Thanks,
Going Nutty!

Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
'Saves new project number
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Declares Pnum as long int
Dim PNum As Long
'PNum is this projectID1 #
PNum = Me.ProjectID1
'Opens Chain of Custody Form
DoCmd.OpenForm "ChainOfCustodyForm"
'Sets ProjectID2 to PNum value
[Forms]![ChainOfCustodyForm].ProjectID2 = PNum
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click
End Sub
 
R

Rich

Guest
Do menu item has been extinct for several years now, Microsoft just keeps forgetting to tell the Wizards


Private Sub Command22_Click()
On Error GoTo Err_Command22_Click

DoCmd.RunCommand acCmdSaveRecord
'Opens Chain of Custody Form
DoCmd.OpenForm "ChainOfCustodyForm"
[Forms]![ChainOfCustodyForm]![ProjectID2] =Me.ProjectID1
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click
End Sub
 

smelly

Registered User.
Local time
Today, 15:15
Joined
May 23, 2002
Messages
44
Thanks!!
 

Users who are viewing this thread

Top Bottom