Tabs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a date field which I have set so the user cannot leave it blank.
However they can still tab by it without the error message appearing. Is
there any way to stop them from tabbing by the field and leaving it blank?

Thanks
 
You can use the field OnExit event to check for Null

Private Sub FieldName_Exit(Cancel As Integer)
If IsNull(Me.[FieldName]) Then
MsgBox "Field Empty"
Cancel = True ' wont let the user exit the field
End If
End Sub

Note: The problem with this method that the user will never be able to exit
the field untill it filled
This is why it's better using the form before update event
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top