I have two fields one call exit date and the other one exit reason. If a date
is enter in the exit date field i want the exit reason to be a require field.
How can i do that
If the date is Null, the reason can be null also?
If so, open the form in design view; view its properties; find the
BeforeUpdate event on the Events tab. Click the ... icon by it and choose
"Code Builder". Edit it to something like the following (use your own textbox
names of course):
Private Sub Form_BeforeUpdate(Cancel as Integer)
If Not IsNull(Me!txtExitDate) Then
If IsNull(Me!txtExitReason) Then
Cancel = True
MsgBox "Please enter an exit reason", vbOKOnly
Me!txtExitReason.SetFocus
End If
End If
End Sub