Want error when field is blank

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
 
K

Kevin Kleinholter

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.
 

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

Top