Creating a validation routine for multiple forms using an array

D

DawnTreader

Hello All

i have 6 forms that i need to validate when people enter in a new record to
those forms. when the user "saves" the record and closes the form i want to
do a double check to make sure that fields are not empty and have the correct
data in them. for instance i want to make sure that dates are entered as to
when the record happened, and some records require 2 dates that must be in
sequence.

i have been doing this on an individual form basis, but i am looking at the
amount of things i am having to code and wondering if there is a way to mark
fields on a form as part of the validation process and then pass the fields
and the data to a public routine or function that would figure out the
validity of the record and then get the user to fix the data.

i was thinking that if my function had a variant variable that was passed by
the form with the fields that were required then the function would check to
see if they were null and then either it would tell the user what fields were
missing data or send back a "go ahead, save and close" to the form.

i thought that this would save me code, but i dont know if it is a good idea
or how to go about it if it is a good idea.

any suggestions?
 
D

DawnTreader

Hello Dale

Wow. that is fantastic and a little creepy...

i was preparing for this idea by going to the forms and putting tags in the
controls "NoNull"...

i guess great minds think alike.

your code looks great, i have yet to try to implement it. will post the
final result. thanks again! :)
 

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