G
Guest
Hello,
I've have been looking at other questions similar to mine, but I still can't
get this to work. I have a button to close a form. On click of that button it
needs to check - If [RptDate] is not null And [Contact] is null, then give
the message that Contact Must be Entered and go to the Null Contact field.
Otherwise, Close the Form. Here is what I have. Thanks!
Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
If Me.RptDate Is Not Null And IsNull(Me.Contact) Then MsgBox "Contact must
be entered."
DoCmd.GoToControl "Me.Contact"
Else
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub
I've have been looking at other questions similar to mine, but I still can't
get this to work. I have a button to close a form. On click of that button it
needs to check - If [RptDate] is not null And [Contact] is null, then give
the message that Contact Must be Entered and go to the Null Contact field.
Otherwise, Close the Form. Here is what I have. Thanks!
Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
If Me.RptDate Is Not Null And IsNull(Me.Contact) Then MsgBox "Contact must
be entered."
DoCmd.GoToControl "Me.Contact"
Else
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub