Link to home
Start Free TrialLog in
Avatar of datasolutionz

asked on

Conditional formatting in listbox items in MS Access

In the attached Access application, reference the form frmPatient. There is a listbox in the bottom right called lstUnprintedRecs. As you are adding new patients (whose records have not been printed), they are populated in the listbox. The purpose of the listbox is to allow the user to quickly reference all unprinted records (patients) by clicking on the list item & navigating to that particular record. Once item is printed, it is deleted from that listbox. All that works.

I would like to be able to color code (to indicate criticality) the listed items in the listbox as I add them. For e.g, when I add a new record (patient), I should be able to specify criticality of patient by selecting either Red, Blue, Green (via another combox box or radio buttons). Hence, when the patient name appears in the listbox as a listed item, it has the background of the specific color? As different patients/records/items are added, each listed item should have the background color specified for it. I doubt this is possible, but thought I'd ask.

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of datasolutionz


Lebans has some stuff that might be useful, but IIRC the colored listbox was never fully complete (and Stepen doesn't do this anymore):

That said, the suggestion by MX is probably your best bet, and the easiest to implement and maintain throughout Access versions.
Not sure why the db is attached ?

<Not sure why the db is attached ?>

I believe it's because the author wrote "In the attached Access application" and then forgot to attach it.
I have implemented a subForm to achieve what I needed. Thanks for everyone's attention
The it would seem you'd accept Databasemx's comment here:


Where he wrote:

"Your other option is to use a datasheet subform instead of list box "

Which is EXACTLY what you did.
I object to any deletion, as noted by LSMConsulting ...

Following an 'Objection' by DatabaseMX (at to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Experts.
At this point I am going to re-start the auto-close procedure.
Thank you,
Community Support Moderator