confused about validation

  • Thread starter Thread starter Andre C
  • Start date Start date
A

Andre C

So I put the data validation code in the before update event of the
form.

I have a button on the form to close the window.

I click the close button, the validation routine tells me I forgot
something and then the form closes and does not give me chance to
retify the mistake.

Why?
 
Because your code runs when you close the form. If you don't want to
close the form, put your routine in the On Unload event instead. There
is a cancel setting that you can set to True, Cancel = True, if you
have validation "error" and your form will not close, allowing you to
fix whatever needs fixing.

Hope that helps!
 

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