Question : Access 2007 form text box exit problem

I have a text box.  It has an On Exit function that looks at the data entered.  If the entry is not appropriate a message pops up and they are returned to the box to reenter the data.

An unexpected result is you cannot leave that box without entering the data.  I have an EXIT button at the bottom of the form to close without saving the data.  When the cursor is the text box and you click on the EXIT button you are prompted to enter the text box data.  Of course, you can enter correct data and eventually select EXIT.  Thats awkward.

There are 6 boxes on my form that are like this.  

Is there a better way to approach the text boxes to make sure I'm getting the correct data but allow the user to exit the form easily.

Thanks,
Brooks

Answer : Access 2007 form text box exit problem

If you have an "Exit" button, do you also have a Save button?  Are your navigation buttons turned on, so that the user can move to another record by clicking one of them?

I generally disable the built in navigation buttons and create my own.  I also prohibit the user from leaving the current record unless they click either a Save or Cancel button.  With that functionality, I can run my validation code in the Click event of the Save button.  I step through each of the controls and make sure that they have valid entries.  If not, I display an appropriate error message and set the focus back to the control which failed the validity test.  Once all fields are valid, I actually save the record.
Random Solutions  
 
programming4us programming4us