473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Listbox - Impossible Problem

I am trying to change the colors of a value in a list box when the
values are is based on a select query. I only want the value to
change colors, if another value associated with in the query meets the
proper criteria. The code that I have does not work however here is
what i have so far.

If Me.Station01.Column(1) = "UI" Then
Me.Station01.Column(0).Value.IsVisible = False
If Me.Station01.Column(1) = "OOS" Then
Me.Station01.Column(0).Value.ForeColor = vbYellow
If Me.Station01.Column(1) = "UC" Then
Me.Station01.Column(0).Value.ForeColor = vbWhite
If Me.Station01.Column(1) = "D" Then
Me.Station01.Column(0).Value.ForeColor = vbRed
If Me.Station01.Column(1) = "E" Then Me.Station01.Column(0).ForeColor
= vbBlue
If Me.Station01.Column(1) = "A" Then Me.Station01.Column(0).ForeColor
= vbCyan
If Me.Station01.Column(1) = "T" Then Me.Station01.Column(0).ForeColor
= vbMagenta
If Me.Station01.Column(1) = "TA" Then Me.Station01.Column(0).ForeColor
= vbWhite
If Me.Station01.Column(1) = "AOR" Then
Me.Station01.Column(0).ForeColor = vbGreen
Nov 12 '05 #1
1 2794
Yes, you are correct that what you want to do is not supported by the Access
List Box. Sorry. There are some solutions for manipulating colors in the UI
at MVP Stephen Lebans' site, http://www.lebans.com. But, I fear that what
you want is even beyond anything he has done.

I suspect you may be able to simulate what you want with an ActiveX grid
control... either one that is included with the Office Developer Edition or
a third-party Control (but be aware that those are not, in Access,
data-bound, so you'll need a good deal of VBA code to populate and manage
it); or, perhaps, with some care and work, using Conditional Formatting
statements in Access 2000 or later, in a continous forms view Form embedded
in a Subform Control.

The last suggestion is probably the easiest for you to test, try, and check
out.

Larry Linson
Microsoft Access MVP

"Mike" <Mi*************@verizon.net> wrote in message
news:22**************************@posting.google.c om...
I am trying to change the colors of a value in a list box when the
values are is based on a select query. I only want the value to
change colors, if another value associated with in the query meets the
proper criteria. The code that I have does not work however here is
what i have so far.

If Me.Station01.Column(1) = "UI" Then
Me.Station01.Column(0).Value.IsVisible = False
If Me.Station01.Column(1) = "OOS" Then
Me.Station01.Column(0).Value.ForeColor = vbYellow
If Me.Station01.Column(1) = "UC" Then
Me.Station01.Column(0).Value.ForeColor = vbWhite
If Me.Station01.Column(1) = "D" Then
Me.Station01.Column(0).Value.ForeColor = vbRed
If Me.Station01.Column(1) = "E" Then Me.Station01.Column(0).ForeColor
= vbBlue
If Me.Station01.Column(1) = "A" Then Me.Station01.Column(0).ForeColor
= vbCyan
If Me.Station01.Column(1) = "T" Then Me.Station01.Column(0).ForeColor
= vbMagenta
If Me.Station01.Column(1) = "TA" Then Me.Station01.Column(0).ForeColor
= vbWhite
If Me.Station01.Column(1) = "AOR" Then
Me.Station01.Column(0).ForeColor = vbGreen

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Geir Baardsen | last post by:
Hi! On frmItems I have a two listboxes. The first, lstAllCategories, is loaded with data from tblCategory when frmItems open. When user click lstAllCategories, the lstSelectedItems will show all...
2
by: Geir Baardsen | last post by:
Hi! I wasn't very clear, I think... On frmItems I have a listbox, lstShowItems, that is being filled up in the forms onload event with all records from tblItems. Now when user navigate...
0
by: John Wood | last post by:
If you run SetSelected on an invisible ListBox it seems to ignore the call. This is especially annoying when the ListBox is on a tab control and the tab isn't selected at startup... it's impossible...
1
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the...
11
by: Timo Kunze | last post by:
Hi! If you move the mouse over an item that's part of a treeview and wider than the treeview, a tooltip showing the full item text will be displayed. I try to do this for ListBoxes and...
5
by: Dave | last post by:
Hi all, Is it possible to populate a listbox from a hashtable (complexbind) where the ValueMember of the listbox maps to the "key" member of the hashtable AND the DisplayMember of the listbox maps...
3
by: ML | last post by:
I have used Allen Brown's technique for filling a listbox on a form with the names of files in a certain disc folder. It works well. I am now giving the user the option to print the form...
2
by: Mirnes | last post by:
I have a listbox which is populated from Sql query and I use it to add values to table. I would like to exclude value which just has been added from listbox. Since it is impossible to do in query...
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the...
1
by: rbr | last post by:
I have two listboxes on an asp.net web control (ascx). I want them to act non-mutually-exclusive. In other words, if an item in one listbox is selected, I want the other to be clear. The problem...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.