Geekpedia Programming Tutorials






Conditional Validation Rules

On Monday, July 28th 2008 at 11:36 AM
By Anonymous
I have set a validation rules for a table and also for fields. Now I need to
set another table validation rule to say:
If field1 = ???complete???, then field2 must be greater than zero (it is a
numeric field).
If field1 = ???incomplete???, then field 2 can be blank or zero.

I have set a validation rule for field1 to either ???complete??? or ???incomplete???
and made it a required field. I want to make field2 a required field also.

I am unsure of how to enter this into the table???s validation rule, or even
the field2 validation rule. Do I just start another line and start typing a
second rule in VB mode for the table? Or do I have to identify each
validation rule? I hope this makes sense.

Re: conditional validation rules

by John on Monday, July 28th 2008 at 07:30 PM
On Mon, 28 Jul 2008 14:35:16 -0700, buscher75
<buscher75@discussions.microsoft.com> wrote:

>I was finally able to get into the be of my database. When I added the
>addtional validation rules, I got an error. "The expression you entered
>has an invalid .(dot) or ! operator or invalid parentheses."

What exactly did you enter? Copy and paste the entire validation rule.
A Table can have only ONE validation rule, not several; you may need
to get into some pretty murky Boolean logic expressions to combine AND
and OR logic appropriately.

It's often easier and more user-friendly to put this kind of
validation in VBA code in a Form's BeforeUpdate event. It's not as
secure - someone could bypass the form - so you may need the complex
table validation rule as well.

--

John W. Vinson/MVP
Latest Tech Bargains

Advertisement

Free Magazine Subscriptions

Today's Pictures

Today's Video

Other Resources

Latest Download

Latest Icons