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

Colouring items in a list

Status
Not open for further replies.

Bug16

Technical User
Oct 2, 2002
22
GB
I'm currently displaying about 100 items in a list that is populated via a SQL statement. These are the condition of certain items.

I now want to be able to colour the items in the list depending on their condition. I.e. Green = good, Red = bad.

I'm beginning to suspect this can't actually be done. Obviously it's easy to colour the list itself but not the individual items in the list.
 
Did you know that Conditional Formatting exists in Access?

In Form Design view, select the appropriate field and select Format/ Conditional Formatting. Does that help?

Simon Rouse
 
No I never knew that existed. However, whenever I select the list "Conditional formatting" is always greyed out. If I select any other objects (Combo Boxes etc) "Conditional formatting" is available. I suspect I cannot conditionally format a list box.
 
When you said list I hoped you didn't mean listbox. I don't think there's any way of doing the differential formatting you want in a listbox.
Clearly I don't know what you are using this for, but another approach that could solve your problem would be to incorporate a subform with each member of the list as a different object. These fields would respond to conditional formatting and you could use code to insert the selected item as appropriate.
 
It's as I suspected then.

"but another approach that could solve your problem would be to incorporate a subform with each member of the list as a different object. These fields would respond to conditional formatting and you could use code to insert the selected item as appropriate."

I thought about this. I think it'll be more pain than it's worth and due to the volumes of data in the listbox I could end up with some severe speed issues.

Thanks for the help anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top