Multi-Select List Box

  • Thread starter Thread starter CHI - JW
  • Start date Start date
C

CHI - JW

Guest
I have been working on a new access database for the NHS but have come up against a problem.

I have created a list box of options from a table and when i change the properties ion the form to a mulitple selecting box it looks ok.

But when you make the selections then move to the next record then move back they have all been reset.

has anyone got any ideas, would be really appreciated.

Jason
 
I also came across this problem whilst doing a database for the NHS ... would love to know if there is an elegant solution.

What i did was created an array of bound hidden check boxes and then made one of them check if the corresponding thing on the list box was highlighted.

Then on current event of the form i looped around the chk boxes and re highlighted the list box.

Hope there is a better way to do it but if not good luck.

Steve
 
This is not a problem, nor is it a bug. Table fields are not intended to store multiple items. This is a violation of first normal form. So although it is useful to have the functionality of a multi-select list box for selecting things, those things cannot be stored to a table by Access because once you change the property of the list box from single to multiple, it becomes unbound.

When you have a need to store multiple items related to a single item, the proper implementation is to use a form with a subform and to use a separate table to store the many-side items.

There is sample code in help and also here in the forum if you search for it that will show you how to loop through the selected items collection of a multi-select list box.
 

Users who are viewing this thread

Back
Top Bottom