Event to use for capturing data for validation

T

Tony Girgenti

What event is best ot use to validate what someone types into a listbox,
combox or textbox ?

Thanks,
Tony
 
A

Allen Browne

Use the BeforeUpdate event of the control to validate the entry.
If you don't like the entry, you can force the user to stay there and fix it
with:
Cancel = True

If you need to compare two entries, or to check that some entry was made,
use the BeforeUpdate event of the form.
 
G

Graham Mandeno

Hi Tony

If you want to validate it before focus passes to another control on your
form, use the control's BeforeUpdate event.

If you want to make minor tweaks to the entered data (for example, convert
it to uppercase, etc) use the control's AfterUpdate event.

If you want to validate all the entered data (maybe including values in
different fields which depend on one another) before the record is saved,
then use the form's BeforeUpdate event.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 

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