For comparing fields, use the validation rule of the table, not that of the
field.
1. Open your table in design view.
2. Open the Properties box (View menu).
3. Beside the Validation Rule, enter:
([Field1] Is Null) OR ([Field1] <> "somevalue") OR ([Field2] Is Not Null)
There are 3 ways this rule can be satisfied:
- Field1 is a null, or
- Field1 has a value other than "somevalue", or
- the only remaining way is that Field2 is not null.
Note: Make sure you use the validation rule in the Properties box (the one
for the table), not the validation rule in the lower pane of table design
(the rule for a field.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
bw said:
How does one code the following as a Validation Rule:
If this field = "somevalue" then another field must not be null
Thanks,
Bernie