Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Font color depending on field value

Status
Not open for further replies.

Catadmin

Programmer
Oct 26, 2001
3,097
US
It's been a while since I've done this, so forgive me for asking.

I have a textbox named "PrimaryKeyLabel". The value of this box is determined by an IIF statement (IF..Then..Else) and the ELSE part returns "Primary Key N/A". I want to set the color property of this textbox so that if it returns the ELSE, the font is Crimson otherwise the font is Black.

I currently have an iif(isnothing(Fields!Primarykey.value), "Crimson", "Black") expression in the color property, but it's not working because a value is always returned. How do I do an iif looking specifically for the value returned from the textbox's iif statement?

Thanks,



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
maybe:

iif(Fields!Primarykey.value="Primary Key N/A" , "Crimson", "Black")

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Tried that. Didn't work. I don't know if it was because I did something else wrong.

Finally put the "Primary Key N/A" value in the Proc returning the data and was able to do the color expression off of that.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
odd - should work from what you described. Ah well - many ways to skin a cat - at least RS allows you to try other stuff if the 1st attempt fails !!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Yeah, well there was a lot of stuff not working that I ended up changing, so one of those other things could have been affecting that textbox and I wasn't even aware of at the time.

Ah well. I love trying to track down multiple points of failure. @=)



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top