Validation Rule

D

Devilshark

I am currently building an Access database for scientific data involvin
30 years of data from different projects with different datasets an
have a question for the more learned out there. I have formatted th
projects so that all of the data are similar. However I would like t
us the validation rule to eliminate the input of erroneous data (ie
dates that don't match). I can get the validation rule to accept
date later than say Jan 1 1980. But there are well over 75 differen
projects that have been incorporated into this database and each has
unique sampling date. What I am trying to do is set the validatio
rule to something resembling an IF/THEN statement (ie, IF Project Name
"Galveston Bay" THEN Date >=#5/12/93# And <=#9/26/95#). Is thi
plausible for the validation rule? Access won't accept it, but tha
may be a syntax error on my part. Or is there a better way? Any hel
would be greatly appreciated. And please understand that I am
biologist and have only some exposure to programing and such. Than
you.

Mike Lowe
NOAA Fisheries
Galveston, T
 
T

TC

You need to do all data entry through forms - not directly into the tables.

Then you can use form "events" to do whatever validation you need.

For example, the BeforeUpdate event of a control (like a textbox), can
validate the data entered into that control. The BeforeUpdate event of the
form<, can do cross-field validations such as, "If textbox 1 is "ABC", date
2 should be entered", and so on.

Perhaps use one of the wizards to generate a default form for a table.
You'll see that you >automatically< get reasonably-ok Add, Edit, Delete and
Find capabilities built-in to the form. Then try adding some events, a I
have mentioned above.

HTH,
TC
 

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