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
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