In the listbox properties window, all you need to do is modify the multiselect property. You can change it to "1-Simple" or "2-Extended". The simple setting lets you choose multiple entries without holding down the control key. When set to extended, you need to hold the control key down when selecting your second, third, etc choices.
You need to populate the listbox manually, with-out connecting to a recordset.
Just loop through the recordset and for each record, use the ListBox1.AddItem method.
rs.MoveFirst
Do Until rs.Eof
ListBox1.AddItem rs(""myField)
rs.movenext
Loop
ListBox1.MultiSelect = True
Then you can do what you want to do.... [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
listbox.multiselect property is read only at run time. You can only set it in the properties box at design time, using the dropdown. Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
when I selected extended on the drop down and run it, it goes back to 0. I tried saving before I ran it, but it didn't help. Could there be something else wrong?
What do you have the "STYLE" property set to? If it's set to checkbox, that could cause a problem. There may be some other property that's causing the multiselect to revert back to 0 but STYLE is the only one that I know of that could cause a problem.
Make sure that you have "unbound" your list box. The easiest thing to do is delete it and add a new list box and give it the same name. Then change the multi select property and see how that works.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.