require field to have a value before closing

B

BLTibbs

I have a form that requires a field to be filled out. I cannot figure out
the best way to alert a user to fill in the field and prohibit the form from
closing until that field has data. How do I do that?
 
O

Ofer

On the before update event of the form you can write the code

If isnull(Me.FieldName) then
msgbox "Must fill field"
cancel = true ' wont let exit the form
Me.FieldName.setFocus
End IF
 
Top