By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Customizing individual items in a list box - is it possible?

P: n/a
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Thu, 26 Feb 2004 04:49:45 GMT, "Colleyville Alan"
<ae***********@nospam.comcast.net> wrote:
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.


When I want something like that, I usually either fake it with a subform, or
use a ListView control. I try to avoid ActiveX controls when possible, so I
aim for the subform approach if I can, but the ListView is more flexible.
Nov 12 '05 #2

P: n/a
DFS
Here's a kludge that might work:

Create a 2nd listbox beside the first one, of the same height and just wide
enough to show an asterisk. Position the 2nd listbox very close to the
right edge of the 1st list. Then in the 2nd listbox, show the asterisk if
the item in the 1st listbox is already chosen.
"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in message
news:FVe%b.407544$xy6.2326443@attbi_s02...
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.

Nov 12 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Besides what S.Jorgensen & DFS have to say - you can create 2
ListBoxes. One has the Available items and the other has the Selected
items. These are similar to selection boxes in the Report wizard -
selecting which fields from a table/query to display on the report -
and various other wizards (duplicates query, etc.).

I have a demo Acc97 .mdb file at http://home.earthlink.net/~mgf00/
(Select Items Between Two List Boxes) that you can download &
experiment with.

You could also just not show those items in the ListBox that are
already on the s/s. You'd have to requery the ListBox each time an
item was placed on the s/s and exclude the items this way:

SELECT ... FROM ...
WHERE itemID not in (<list of items IDs on s/s>)
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQD5HJIechKqOuFEgEQJB7wCffVwxr+Fzc3kzMEOhjxQuIZ/Mb2EAoMl7
DnrgvBBlBy5OVF5COijx1Jng
=BFp5
-----END PGP SIGNATURE-----
Colleyville Alan wrote:
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?


Nov 12 '05 #4

P: n/a
Thanks for the help

"MGFoster" <me@privacy.com> wrote in message
news:JG*****************@newsread2.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Besides what S.Jorgensen & DFS have to say - you can create 2
ListBoxes. One has the Available items and the other has the Selected
items. These are similar to selection boxes in the Report wizard -
selecting which fields from a table/query to display on the report -
and various other wizards (duplicates query, etc.).

I have a demo Acc97 .mdb file at http://home.earthlink.net/~mgf00/
(Select Items Between Two List Boxes) that you can download &
experiment with.

You could also just not show those items in the ListBox that are
already on the s/s. You'd have to requery the ListBox each time an
item was placed on the s/s and exclude the items this way:

SELECT ... FROM ...
WHERE itemID not in (<list of items IDs on s/s>)
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQD5HJIechKqOuFEgEQJB7wCffVwxr+Fzc3kzMEOhjxQuIZ/Mb2EAoMl7
DnrgvBBlBy5OVF5COijx1Jng
=BFp5
-----END PGP SIGNATURE-----
Colleyville Alan wrote:
I am trying to use a list box to allow users to select items, the results are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather than reducing it. Is it possible to format an individual row in a listbox to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.