Insert the word red, green or yellow based on a value

G

Guest

I am trying to insert a word like "Green" if the value is <1 or red if the
value is >2 but less < 3 or Red if the value is >3.

Can someone help?

Thank You

AL
 
D

Douglas J. Steele

What do you want if the value is between 1 and 2? I'm going to assume that
what you meant to say was you want Green if the value is < 1, Yellow if the
value is >= 1 and <= 3, and Red if the value is > 3. Set the ControlSource
of the text box to the following (including the = sign):

=IIf([MyValue] < 1, "Green", IIf([MyValue] <= 3, "Yellow", "Red"))


(replace [MyValue] with the actual field name)
 
G

Guest

Works Fantastic,

Thank you...

AL

Douglas J. Steele said:
What do you want if the value is between 1 and 2? I'm going to assume that
what you meant to say was you want Green if the value is < 1, Yellow if the
value is >= 1 and <= 3, and Red if the value is > 3. Set the ControlSource
of the text box to the following (including the = sign):

=IIf([MyValue] < 1, "Green", IIf([MyValue] <= 3, "Yellow", "Red"))


(replace [MyValue] with the actual field name)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


AL Rios said:
I am trying to insert a word like "Green" if the value is <1 or red if the
value is >2 but less < 3 or Red if the value is >3.

Can someone help?

Thank You

AL
 

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