S
steve12173
I have a form that has several text boxes but, 4 of them are required. There
is a command button to close the form when completed. I want to include in
the VBA, that when the command button is clicked, if any of the required
fields are blank, a msgbox displays, asking the user to fill in the required
fields. If the fields are not blank, then continue with the close.
Here is the VBA for the command button:
Private Sub Command81_Click()
On Error GoTo Err_Command81_Click
DoCmd.Close
Exit_Command81_Click:
Exit Sub
Err_Command81_Click:
MsgBox Err.Description
Resume Exit_Command81_Click
End Sub
Thanks in advance!
is a command button to close the form when completed. I want to include in
the VBA, that when the command button is clicked, if any of the required
fields are blank, a msgbox displays, asking the user to fill in the required
fields. If the fields are not blank, then continue with the close.
Here is the VBA for the command button:
Private Sub Command81_Click()
On Error GoTo Err_Command81_Click
DoCmd.Close
Exit_Command81_Click:
Exit Sub
Err_Command81_Click:
MsgBox Err.Description
Resume Exit_Command81_Click
End Sub
Thanks in advance!