Conditional fill colour of a rectangle

Stuart Green

Registered User.
Local time
Today, 15:22
Joined
Jun 24, 2002
Messages
108
I have a report with a rectangle on it. What I would like is for the fill colour to change depending on the value in a field on the report. So, if the value is 1, fill colour green, if 2 then fill with red etc. Can this be done please?
 
I'm not sure if you can do this but if you have A2k, you could use a unbound textbox instead and use the conditional formatting tool from the format menu (very similar to Excel).
 
Thanks Fizio, this works fine..up to a point. Can only get 3 conditions per textbox so I will have to overlay other unbound boxes on the report until I can get the full 0 to 9 range. Thanks once again
 
Damn..tried overlaying but it won't let you have a transparent fill as the default fill within the condition. So, one box hides the others. Back to the drawing (colouring) board I think
 
Managed to get it to work - silly bugger I forgot about the transparency!

In the section where the control is

eg Detail_Format()
select case me.nameofcontrol

with me.nameofcontrol

case 0
.backcolor = 255 'Red
.backstyle = 1


case 9

case else
.backstyle = 0

end with
end select

I'm fairly sure this will work but I have not tried it with rectangles yet but I'm sure the principle will be the same.
 

Users who are viewing this thread

Back
Top Bottom