Mutiple items selected in a list box

  • Thread starter Thread starter Steven M. Britton
  • Start date Start date
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
 
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 & "..."
 
Back
Top