I am not sure what you are looking for in the SQL select statement but the following will take and add OR between all the value which have been selected in a multi select listbox.
As you can see this code was set up for the click of a button but you can associated with the event that will work best for you.
Private Sub Command2_Click()
Dim strItems As String
Dim varItm As Variant
Dim cntr As Integer
For Each varItm In List0.ItemsSelected
cntr = cntr + 1
If cntr < List0.ItemsSelected.Count Then
strItems = strItems & List0.Column(0, intCurrentRow) & " OR "
Else
strItems = strItems & List0.Column(0, intCurrentRow)
End If
Next varItm
MsgBox (strItems)
End Sub
Thank You very much. This works; however it retrieves just the row number is there anyway I can retrieve the actual data for example if I select the first option in the list box the code returns 1 and the first option is Concept...is there anyway I can get it to return Concept instead of the value 1?
Thanks
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.