display items selected in a list

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a form with a multi-select list, which is working
fine to select items for a person. When I move from one
record to the next, all I see is the complete list with
none of the items highlighted. I'd like to see the
selected items highlighted as I move from one record to
the next.

What code can I use to highlight the already selected
items in the list for a person as I move from one record
to the next?

Additionally, is there a way to unselect an item
previously selected?

Thank you.

...John
 
Hi John

What do you mean by "the selected items" and how are they being stored in
your table?

A multi-select listbox is useless as a bound control, because its value will
always be Null, no matter what items are selected.

Do you have a related table with one record per selected item (the correct
normalised structure) or do you have all the selected items somehow stored
in a single field (the horrible structure)?

Either way, you will need code in your Current event procedure to set the
selection for the current record, and code in the listbox's AfterUpdate
procedure to select/remove the selections in the relevant record(s).
 
-----Original Message-----
Hi John

What do you mean by "the selected items" and how are they being stored in
your table?

A multi-select listbox is useless as a bound control, because its value will
always be Null, no matter what items are selected.

Do you have a related table with one record per selected item (the correct
normalised structure) or do you have all the selected items somehow stored
in a single field (the horrible structure)?

I have the correct normalised structure. A separate table
stores the ID of the person and the IDs of the selected
items from the list.
Either way, you will need code in your Current event procedure to set the
selection for the current record, and code in the listbox's AfterUpdate
procedure to select/remove the selections in the relevant
record(s).

I'm working with/adapting some code that I found on the
internet. I'm not done yet :)

I'll repost my problem if I'm unable to figure it out.
Thanks for your help.

...John
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a form with a multi-select list, which is working
fine to select items for a person. When I move from one
record to the next, all I see is the complete list with
none of the items highlighted. I'd like to see the
selected items highlighted as I move from one record to
the next.

What code can I use to highlight the already selected
items in the list for a person as I move from one record
to the next?

Additionally, is there a way to unselect an item
previously selected?

Thank you.

..John


.
 
Back
Top