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
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: