Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conditional Validation Rules

0 views
Skip to first unread message

Mark

unread,
May 13, 2003, 7:02:49 AM5/13/03
to
Can you have conditional validation rules in a form or
table because I can't seem to be able to get it to work?

I'm trying to set a conditional validation that is

iif [type] = "Cheque" then [Cheque No] is null else
[Cheque No] is not null

([type] and [Cheque No] are both fields in my data table
and also text boxes within my form)

Hope you can help

Steve Schapel

unread,
May 13, 2003, 12:02:46 PM5/13/03
to
Mark,

You can't refer in a field validation rule to the value in another
field. However, in the table design, you can establish a table-level
validation rule. Go tot he View menu, select Properties, and then,
rather than using IIf(), it will look like this...
([type]="Cheque" And [Cheque No] Is Null) Or ([type]<>"Cheque" And
[Cheque No] Is Not Null)

Another approach would be to use code on the form, as applicable (e.g.
the BeforeUpdate event of the form, or the AfterrUpdate event of the
Type and/or Cheque No controls) to test the data and MsgBox if it
doesn't comply.

- Steve Schapel, Microsoft Access MVP


On Tue, 13 May 2003 04:02:49 -0700, "Mark" <Mark....@cwcom.net>
wrote:

0 new messages