D
Design by Sue
We have a form in which we wish to validate the data in each field as
the use exits the field. For example we have a part number field which can’t
be null or blank so we have the following code in the exit event for that
field.
Private Sub PartNumberTxt_Exit(Cancel As Integer)
If IsNull(Me.PartNumberTxt) Or Me.PartNumberTxt = "" Then
Cancel = True
strMsg = strMsg & vbCrLf & "Please enter a Wheel Number. "
MsgBox strMsg, vbExclamation, "ATTENTION"
End If
End Sub
However this event fires when the user clicks the close button, prompting
the user to enter a number which is annoying. Is there anyway around this
the use exits the field. For example we have a part number field which can’t
be null or blank so we have the following code in the exit event for that
field.
Private Sub PartNumberTxt_Exit(Cancel As Integer)
If IsNull(Me.PartNumberTxt) Or Me.PartNumberTxt = "" Then
Cancel = True
strMsg = strMsg & vbCrLf & "Please enter a Wheel Number. "
MsgBox strMsg, vbExclamation, "ATTENTION"
End If
End Sub
However this event fires when the user clicks the close button, prompting
the user to enter a number which is annoying. Is there anyway around this