require field to have a value before closing

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

Guest

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?
 
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
 

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