Rule needs if statement to test two values before filling a test b

C

c9ola

I have 2 independent fields on a form:
A (Date)
B (TextO
The value of both of these together will determine the value of "C," a text
box. I need an "if" statement but how does that work in the Rules section
of a text box? BTW . . . field "C" is read-only and can not be changed by a
user.

Example:

If A = "Life" then
If B between 1/1/2008 and 3/31/2008 then
C = "1Q 2008"
else if B between 4/1/2008 and 7/31/2008 then
C = "2Q 2008" ......................
else if A = "CCC" then
If B between 1/1/2008 and 2/29/2008 then
C = "1Q 2008"
else if B between 3/1/2008 and 6/30/2008 then
C = "2Q 2008"
end if
end if

If there's a better way to do this, I'm open for that as well, but the
bottom line is - where and how do you write a rule that will take both A and
B into account and then assign a value to C? Hope this makes sense. Thank
you.
 
S

S.Y.M. Wong-A-Ton

You can create a rule for each if statement except the first one, and add
Conditions on the rules. So the first rule might look something like the
following:

Action >> set a field's value C = "1Q 2008"
Condition >> A is equal to "Life" AND B is greater than 2008-01-01 AND B is
less than or equal to 2008-03-31

Hopefully you created B as a date field with the Date data type?

To have the rule run when either A or B changes, you will have to add the
rule individually to both fields.
 

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