M
Martin \(Martin Lee\)
I have LISTBOX62 with several Dealer names in it for multiple choose( for
example Dealer1, Dealer2, Dealer3, ...)
I now want to multiple select the Dealer names in the LISTBOX62, and then
click a BUTTON32 to open a FORM38 with the filter (criteria) of the selected
Dealer names.
How to write this VBA? Thank you.
P.S. I have tried the following VBA, but can't work:
Dim varItem As Variant
Dim itemList As String
For Each varItem In List62.ItemsSelected
itemList = itemList & "'" & List62.ItemData(varItem) & "',"
Next varItem
If itemList <> "" Then
itemList = Left(itemList, Len(itemList) - 1)
DoCmd.OpenForm "FORM38"
Forms!FORM38.Filter = "DEALERNAME like '" & ItemList & "'"
Forms!FORM38.FilterOn = True
EndIf
example Dealer1, Dealer2, Dealer3, ...)
I now want to multiple select the Dealer names in the LISTBOX62, and then
click a BUTTON32 to open a FORM38 with the filter (criteria) of the selected
Dealer names.
How to write this VBA? Thank you.
P.S. I have tried the following VBA, but can't work:
Dim varItem As Variant
Dim itemList As String
For Each varItem In List62.ItemsSelected
itemList = itemList & "'" & List62.ItemData(varItem) & "',"
Next varItem
If itemList <> "" Then
itemList = Left(itemList, Len(itemList) - 1)
DoCmd.OpenForm "FORM38"
Forms!FORM38.Filter = "DEALERNAME like '" & ItemList & "'"
Forms!FORM38.FilterOn = True
EndIf