G
Guest
Hi,
I have a data entry form in Access 2000. If the operator tries to tab out of
certain fields without entering data, I want to prompt them to do so, then
return the cursor to that field. I tried:
Private Sub Salesperson_LostFocus()
If IsNull(Me.Salesperson.Value) Then
MsgBox ("Please Select a Salesperson")
DoCmd.GoToControl "Salesperson"
Exit Sub
End If
End Sub
This gives me the Message Box but the cursor goes to the next field. I've
also tried:
Salesperson.SetFocus and tried moving the DoCmd above the MsgBox, but
neither worked.
I'm not very experienced in VB. What am I doing wrong?
Thanks,
I have a data entry form in Access 2000. If the operator tries to tab out of
certain fields without entering data, I want to prompt them to do so, then
return the cursor to that field. I tried:
Private Sub Salesperson_LostFocus()
If IsNull(Me.Salesperson.Value) Then
MsgBox ("Please Select a Salesperson")
DoCmd.GoToControl "Salesperson"
Exit Sub
End If
End Sub
This gives me the Message Box but the cursor goes to the next field. I've
also tried:
Salesperson.SetFocus and tried moving the DoCmd above the MsgBox, but
neither worked.
I'm not very experienced in VB. What am I doing wrong?
Thanks,