Drop Down Menu in Form from Existing Table--Multiple Selections

G

Guest

HI,
I learned how to use a unbounded list box in a form to creat a dropdown list
of items to send the results to a query [forms]![formname]![listname].
Currently this allows me to only select one item from the list to send to
the query. How can I make multiple selections at the same time....either
contiguous or non contiguous? Is there some property of the list box that I
need to turn off or on to allow multuple selections?

THanks.
 
M

Mark Phillipson

Hi,

Try setting the Multi Select Property to Simple or Extended.

To know which items have been selected in code use the List Boxes
ItemsSelected property to return a collection of variants. Then with a
particular variant get the item value by using the Column property:

Dim varItm As Variant
Dim ctl as Control
Set ctl = Me!Names
For Each varItm In ctl.ItemsSelected
Debug.Print ctl.Column(0,varItm)
Next varItm

--
HTH

Mark Phillipson

Free Add-Ins at; http://mphillipson.users.btopenworld.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top