This is an example of code that uses a multi-select ListBox control. This is an area that seems to cause confusion and difficulty for many of our members.
Code:
Dim valSelect As Variant
Dim strValue As String ' just used for the demonstration
For Each valSelect In Me.listboxName.ItemsSelected
strValue = strValue & "'" & Me.listboxName.ItemData(valSelect) & "', "
Next valSelect
' to remove trailing comma
strValue = Left(strValue, Len(strValue)-2)
Comment