L
Lloyd
I am doing some data verification in my subform, but users are able to get
around this by just selecting the X and closing the form while in the field.
Is there a way in the fields on exit event, that when the code runs telling
the user they must enter the required data that it also stops the form from
unloading? Otherwise I assume my only option is to put the same code in the
forms unload event, is that correct?
sample code below:
Private Sub Method_Exit(Cancel As Integer)
If Me.PersonCaseType Like "Mur*" And Me.PersonType = "Victim" Then
If IsNull(Me.Method) Then
MsgBox "You must enter a Method of Attack for this person", vbCritical,
"Enter a Method of Attack"
Cancel = True
End If
end sub
around this by just selecting the X and closing the form while in the field.
Is there a way in the fields on exit event, that when the code runs telling
the user they must enter the required data that it also stops the form from
unloading? Otherwise I assume my only option is to put the same code in the
forms unload event, is that correct?
sample code below:
Private Sub Method_Exit(Cancel As Integer)
If Me.PersonCaseType Like "Mur*" And Me.PersonType = "Victim" Then
If IsNull(Me.Method) Then
MsgBox "You must enter a Method of Attack for this person", vbCritical,
"Enter a Method of Attack"
Cancel = True
End If
end sub