Mutiple items selected in a list box

S

Steven M. Britton

I need to have a list box that a user can use the
ctrl+click windows default select option. After the user
selects two or three or more items from the list box I
need to able to run a query that uses those selected items
as the criteria. Any ideas? Or direction?

-Steve
 
A

Alex Dybenko

First see online help for selected property, you can collect all selected
item into string:

For intCurrentRow = 0 To ctlSource.Listcount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(0, intCurrentRow) & ","
End If
Next intCurrentRow

then construct SQL where using IN()

"...where PKID in (" & strItems & "..."
 

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