A family of Microsoft relational database management systems designed for ease of use.
I have put it on the exit event as you suggest. How do I use the cancel argument? I am self taught so my education here is lacking. Thanks.
If you look at the event procedure shell that Access builds for you, you'll see that it looks something like this:
'------ start of code ------
Private Sub Sub_Exit(Cancel As Integer)
End Sub
'------ end of code ------
You see the "Cancel" argument? Although it is typed as Integer, it's really a Boolean, and if you set it to True it will cancel the Exit event and keep the focus from leaving the control. So for your purposes, you might write:
'------ start of code ------
Private Sub Sub_Exit(Cancel As Integer)
If IsNull(Me.Sub) Then
MsgBox "You must enter a modality"
Cancel = True
End If
End Sub
'------ end of code ------