Event to use for capturing data for validation

  • Thread starter Thread starter Tony Girgenti
  • Start date Start date
T

Tony Girgenti

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

Thanks,
Tony
 
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.
 
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.
 
Back
Top