Hi everybody,
I would like use the values from a multiple selection in a list-box for further queries. Therefore, I have started to use a button to control selected values from the list-box (named: Automatisierungen):
Private Sub Befehl_Click()
Dim varItem As Variant, strq As String
strq = ""
For Each varItem In Me.Automatisierungen.ItemsSelected
strq = strq & "OR qry_value.value ='" & Me.Automatisierungen.ItemData(varItem) & "' "
Next varItem
Debug.Print strq
If click on e.g. two items in my list-box (SM and SMC), I will get the following result by using “Debug.Print”:
OR qry_value.value ='SM' OR qry_value.value ='SMC'
Thus I think it basically works, but I would like to have just the results “SM” OR “SMC” without the whole code.
Do you have any ideas, what I have to change?
Best regards,
Timo