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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting based on visibility

Status
Not open for further replies.

AlphaStu

Programmer
Mar 8, 2005
11
GB
Hi,
I am completely stuck on this and would appreciate some help.

In a table I would like to change the colour of the font of the data in textbox1 based on the visibility of textbox2. Is this possible or can you only use expressions based on the value of the data?

This works to change the colour if textbox2 is 100 for example

=iif(fields!textbox2.value = 100,"RED",BLUE")

but how can I change this to look at the visibility of textbox2?

Many thanks in advance
 
You need to set a parameter to equal (for example) A if the visibility of textbox2 is True or B if the visibility of textbox2 is False. You can use any values you want if A & B don't suit.

Then put an expression in the color properties of textbox one something like =iif(parameters!<myParamName>.value = A,"RED",BLUE")

Make sense?

I actually did something similar by having a parameter (user driven) that would show/hide other boxes depending on whether the user chose to view the report compressed or expanded.

Hope this helps you out.



Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
 
Thanks Catadmin, that makes some sort of sense to me, however I am a little unsure on how I would set a parameter to A or B depending on if it is visible or not?

Thanks again
 
Can someone help me out with the response that Catadmin left please?

The bit where is says

You need to set a parameter to equal (for example) A if the visibility of textbox2 is True or B if the visibility of textbox2 is False.

I'm not too sure how to set a parameter based on the visibility of something.

Thanks
Stuart
 
off the top of my head...

iif(textboxName.visible = false, "Textbox Hidden","Textbox Visible")

or

iif(textboxName.visible = false, "B","A")


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top