I have a form where all the fields are required fields. All fields are supposed to be filled in and when complete, a Submit button is clicked. Right now the code associated with the Submit button looks like this:
Private Sub Label33_Click()
If MsgBox("Are you sure you want to Submit (Press no to return to editing)?", vbYesNo) = vbYes Then
MsgBox "Thank you for your submission. WRITE DOWN THE TRACKING ID SO YOU CAN TRACK THE STATUS. A member of the Suggestion Box Team will contact you."
DoCmd.Quit
End If
End Sub
When a field is left blank and the submit button is clicked, it goes through the messages above, then gives a default Access message (not very helpful) that all fields have to be completed.
Also, if no entries have been entered and the submit button is clicked, it goes through the messages above and closes out the database. (no records are entered but gives the impression that a record WAS entered)
What I would like to happen is:
- if no data has been entered and the submit button is clicked, that an error message appears with the wording, "all fields must be filled in before submitting."
- if one or more fields are left blank, the same error message as in 1. appears.
- if all fields have been filled in, the wording in the above code appears.
Thank you.