Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

complex validation 1

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
US
I have a form that is used to add or change records in a table. I would like to add logic to edit or validate the data before the record is updated. I know you can associate a validation rule with a field in the table. But how do you handle situations where the rules could be complex and involve several fields? Also, how do you handle warnings? I've thought about putting the logic in the Form_BeforeUpdate event and using msgbox to display the messages, but that seems messy if there could be a lot of errors or warnings on the form. Thanks
 
How are ya BitZero . . .

The [blue]Before Update[/blue] is perfect for this!

What you do is write you validation code in some priority order, then instead of showing all messages show the 1st detected and set the cancel property. In this fashion the user is allowed to make corrections one by one until all validation passes.

Your Thoughts? . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top