I have an access database and I want to make a report based on items selected from a list box, I wrote following codes for that purpose, can anybody help me and tell me what's wrong with my codes? Thanks for your help
Dim arr() As Variant, item As Variant, strRowSource As String, s As String
With Me.lstOptions
ReDim arr(.ItemsSelected.Count - 1)
For Each item In .ItemsSelected
arr(item - 1) = .ItemData(item)
Next
End With
s = Join(arr, ",")
strRowSource = "Select cityName from tblMain Where cityName In (" & s & ")"