This code will undo my changes after displaying the message and then close the form, but all I want it to do is display the message and set the focus to the empty field. Below is the code:
Should I use If IsNull instead and put this code on the OK button?
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Trim(cboTypeofAddress.Value & "") = "" Then
MsgBox "You must provide data for Type of Address.", _
vbOKOnly, "ETA - Required Field"
Cancel = True
End If
End Sub
Should I use If IsNull instead and put this code on the OK button?