Validation Rules in Outlook Forms

G

Guest

I am in the process of designing an Outlook Form. Field 1 & Field 2 are both text fields. If Field 1 is blank, Field 2 must be blank. If Field 1 is non-blank, Field 2 must be non-blank. How can I apply both of these rules to Field 2?
 
S

Sue Mosher [MVP-Outlook]

The basic requirement for a validation rule is that the expression used for
the rule evaluate to True if the data is valid and False if the data is
invalid. In your case, you have two scenarios. Each scenario must be
represented by an expression.

Scenario 1: If Field 1 is blank, Field 2 must be blank.

An expression that evaluates to True only if both these conditions are met
is:

([Field1] = "") AND ([Field2] = "")


Scenario 2: If Field 1 is non-blank, Field 2 must be non-blank.

An expression that evaluates to True only if both these conditions are met
is:

([Field1] <> "") AND ([Field2] <> "")

Put them together with OR (because either one or the other scenario is
possible):

(([Field1] = "") AND ([Field2] = "")) OR (([Field1] <> "") AND ([Field2]
<> ""))

Make sense?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



LEM said:
I am in the process of designing an Outlook Form. Field 1 & Field 2 are
both text fields. If Field 1 is blank, Field 2 must be blank. If Field 1
is non-blank, Field 2 must be non-blank. How can I apply both of these
rules to Field 2?
 
G

Guest

The validation expression must evaluate to True or False:

(([Field 1] = "") AND ([Field 2] = "")) OR (([Field 1] <> "") AND ([Field 2] <> ""))
 

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