I am trying to pass a value from FORM1 OnClick button event to FORM2 query parameter.
Somehow it is not accepting the value.
In FORM1, I am passing mr_number (textbox value) as follow:
Code:
Private Sub CommandAdd_Click()
On Error GoTo CommandAdd_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
DoCmd.OpenForm "FORM2", acNormal, "", , acEdit, acNormal, Me.mr_number
CommandAdd_Click_Exit:
Exit Sub
---------------------
In FORM2, I am accepting the value in Form_Load as follow:
Code:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.mr_number = Me.OpenArgs
End If
End Sub
----------------------
My Query's where clause is:
WHERE (((Pt.mr_number)=[Forms]![FORM2]![mr_number]));
----------------------
I do not receive any error. Just that an empty FORM2 pops up.