E
emma
Hi all!
I am trying to require that a field on a form be filled in
by the user. They should not be allowed to tab past the
field. So I want a message box to pop up when they try to
tab past the field without putting anything in it.
I was thinking that I should put the code in the Lost
Focus event of the field as follows:
Private Sub Accounting_Reference_No_LostFocus()
If Forms!frm_Request.Accounting_Reference_No = "" Then
MsgBox ("You must enter a reference number")
End If
End Sub
However, when I tab out of the field my msgbox does not
appear. What am I doing wrong?
I am trying to require that a field on a form be filled in
by the user. They should not be allowed to tab past the
field. So I want a message box to pop up when they try to
tab past the field without putting anything in it.
I was thinking that I should put the code in the Lost
Focus event of the field as follows:
Private Sub Accounting_Reference_No_LostFocus()
If Forms!frm_Request.Accounting_Reference_No = "" Then
MsgBox ("You must enter a reference number")
End If
End Sub
However, when I tab out of the field my msgbox does not
appear. What am I doing wrong?