Null in conditions

G

Guest

I am writing a macro with conditions and I want one thing to happen if one or
more of three fields in a form are empty and another if none are empty. I
have tried various conditions like "(not IsNull("field1")) or (not
IsNull("field2")) or (not IsNull("field3")). Could someone please suggest a
condition for the above examples.
Thank You for your time.
 
S

Steve Schapel

Pezza,

The example you gave would evaluate to "at least one of the 3 fields has
data". If that's what you want, the correct syntax would be...
[field1] Is Not Null Or [field2] Is Not Null Or [field3] Is Not Null

If you want "one or more of the 3 fields are empty", it would be...
[field1] Is Null Or [field2] Is Null Or [field3] Is Null
This could be simplified to...
[field1]+[field2]+[field3] Is Null

If you want "none of the 3 fields is empty", it would be...
[field1] Is Not Null And [field2] Is Not Null And [field3] Is Not Null
This could be simplified to...
[field1]+[field2]+[field3] Is Not Null
 

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