Want error when field is blank

  • Thread starter Thread starter Joy
  • Start date Start date
J

Joy

I've got a form set up with required fields. My problem
is I don't get the error message until I'm ready to save
the record. I want to set it up so when I leave the field
I get the error instead of at the end of the record.

If that can't be done easily, my second alternative is -
at the time I click OK on the error message, my cursor is
sent back to the field that needs to be entered.

Can anyone help?
Thanks,
Joy
 
You can use a message box that pops up on lost focus
for example, in the lost focus event of a text box place this code
if txtBox1.text = "" then
msgbox "Please enter the required information"
txtBox1.setfocus
end if

This will take them back to the text box they were at and not allow them
to leave until the information has been entered.
 
Back
Top