473,473 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting background colour in list box

5 New Member
Is there any way that I can setup the equivalent of Excel Conditional formatting in an Access list box form control?

What I need to do is populate a list box from query by looping through the query dataset but I want to set the background colour of the column dependant on the contents of the column.

Any help greatly appreciated.
Oct 30 '06 #1
3 6217
MMcCarthy
14,534 Recognized Expert Moderator MVP
Is there any way that I can setup the equivalent of Excel Conditional formatting in an Access list box form control?

What I need to do is populate a list box from query by looping through the query dataset but I want to set the background colour of the column dependant on the contents of the column.

Any help greatly appreciated.
Conditional formating in access is very limited and is only available on textboxes not on listboxes I'm afraid. Outside of setting column width and listbox dimensions I'm afraid there is no formating available on listboxes conditional or otherwise.
Oct 30 '06 #2
Killer42
8,435 Recognized Expert Expert
Conditional formating in access is very limited and is only available on textboxes not on listboxes I'm afraid. Outside of setting column width and listbox dimensions I'm afraid there is no formating available on listboxes conditional or otherwise.
Just a stab in the dark - perhaps you could do it by subclassing? Haven't thought about that in years, but I recall it being used to put colours and images in pull-down menus, and lots of similar things. This was in VB6 or earlier, but I imagine one could do something similar in Access VB.
Oct 30 '06 #3
Killer42
8,435 Recognized Expert Expert
Sorry, can I just get some clarification?

Are we talking about changing the colour of the whole list, or of individual entries? For the whole list, the BackColor property should allow you to do what you like, via a macro (I assume) or VB procedure. For individual entries, subclassing might allow you to do it, but I was never really familiar with the area.

None of this really applies, of course, if you must have exactly the type of automatic functionality provided by Excel's conditional formatting. But an event procedure running your code may provide the next best thing.

If you want to be able to set it up from just the control parameters, perhaps you could store values in the Tag property to indicate the functionality to be performed, and invoke a generic routine which works for any listbox.
Oct 30 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John D | last post by:
I am trying to change the background colour of either a div or a textarea with javascript, but am having problems. I have passed a hex colour value in the variable hval, and with the following...
4
by: Dj Frenzy | last post by:
Hi, I know how to use javascript to change a background image to another background image, and how to change a background colour to another background colour. Is there a way to change an image to a...
7
by: miked | last post by:
Hi, On a webpage I'm authoring I'm having a problem with setting the text background colour. I'm using this: P {color ="FFFFFF"; background-color:"000000"; font-size:10pt; font-family:...
4
by: Lachlan Hunt | last post by:
Hi, I'm looking for an interoperable method of determining the current background colour of an element that is set using an external stylesheet. I've tried: elmt.style.backgroundColor; but...
2
by: jabberwhocky | last post by:
I have designed a website in IE which works perfectly, the problem is that when I look at it in the latest version of Mozilla/Firefox 2.0 the Table Background colour is not displayed, but only the...
2
by: Mike.Wolowicz | last post by:
I have a report that changes background colour when a running total field hits a certain value... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If >= 2400001 Then...
2
by: kronecker | last post by:
I want to set the custom colour &H0000BDBF& which I got from a colour picker program. I need to set this as the background colour to a Label. I tried Label1.backgroundcolor = etc but it is not...
3
by: bettyboo | last post by:
Hi I'm new to the forum and also a VERY new user of Access to develop databases. I'm building a DB for a driving instructor acquaintance, and he wants a button on the pupil data entry form which...
19
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.