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

More than 3 conditional formats for a single control?

Status
Not open for further replies.

rplant

MIS
Aug 20, 2002
10
US
Is it possible to specify more than 3 conditions for a single control? Thanks.

Cheers.
 
Hi rp,

Can you be more specific? i.e. What type of control and what conditions?

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Thank you for the reply. Here is what I'm trying to do:

I need to base the color of a rectangle on the data in a text box.

If the value of "avgStatus" is between 1-2 the rectagle needs to be red,

If the value of "avgStatus" is between 2-3 the rectagle needs to be blue,

If the value of "avgStatus" is between 3-4 the rectagle needs to be green,

If the value of "avgStatus" is between 4-5 the rectagle needs to be purple,

If the value of "avgStatus" is between 5-6 the rectagle needs to be yellow,

The problem is the the conditional formating limits you to 3 conditions. Any help would be excellent. Thanks.

Cheers.
 
Not sure about this, but I wonder about using the Switch function.
Tom
 
Hi,

Sorry - this ain't possible:

You are saying if status is between 1 and 2 then colour is red, if it is between 2 and 3 colour is blue.

According to the above, the colour can be either red or blue if value is 2: which is it if value is 2?

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Hi there,

This may seem crude, but should work. You could overlay several textboxes, one for each colour. Set all the textboxes properties:
[tt]
FontName: Webdings
FontSize: 77 (large)
Background: Transparent
ForeColor: (one color for each textbox)
[/tt]
Then for each textbox, set the ControlSource property:
[tt]
=Iif([avgStatus] >=1 AND [avgStatus] <2,&quot;gggggggggggggg&quot;,&quot;&quot;)
[/tt]

That is, use the forecolor of textboxes for the different colours. The 'g' character of Webdings gives a solid square 'character' - you just need enough of them to fill the textbox.

Hope this helps,
Cheers.
Dan
 
Obviously I don't know your controls, but here's a thought.

Using the Switch function, could you say &quot;if the status is between 1.00 and 2.00 it's red&quot;, and &quot;if the status is between 2.01 and 3.00 it's blue&quot;, etc.

Maybe. Maybe not. You will know by your controls.
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top