Code:
Private Sub Command2_Click()
On Error Resume Next
StrListItem_ = ""
Dim ctl
Set ctl = Me!List0
Dim i As Integer
For Each varItem In ctl.ItemsSelected
StrListItem_ = StrListItem_ & "," & Me.List0.ItemData(varItem)
Next varItem
End Sub
Public StrListItem_ As String
Public Function SetListItem() As String
SetListItem = Right(StrListItem_, Len(StrListItem_) - 1)
End Function
Code:
SELECT *
FROM Table1
WHERE (((Table1.MName) In (SetListItem())));