S
sdh31873
I have a form with some required fields. When they fail to enter data in
that field, it pops up a message box. It takes them back to that field.
What if they don't know the information and they want to close the form? I
can't get that to work. I have added a "Close Form" button but it won't stop
prompting with the msgbox from the required field. Any help in this matter?
Here is the code. Thanks.
that field, it pops up a message box. It takes them back to that field.
What if they don't know the information and they want to close the form? I
can't get that to work. I have added a "Close Form" button but it won't stop
prompting with the msgbox from the required field. Any help in this matter?
Here is the code. Thanks.
Code:
Private Sub ContactName_Exit(cancel As Integer)
If IsNull(Me.ContactName) = True Then
MsgBox "The Contact Name is required", vbExclamation, "Missing Data"
cancel = True
Me!ContactName.SetFocus
Exit Sub
End If
End Sub