Tabs

B

Blade370

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
 
O

Ofer Cohen

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
 
Top