The following would list them, separated by commas in a text box on the form:
Dim varItem As Variant
Dim strItemList As String
Dim ctrl As Control
Set ctrl = Me.lstYourListBox
' iterate through list box's ItemsSelected collection
' and build list if any items selected
If ctrl.ItemsSelected.Count > 0 Then
For Each varItem In ctrl.ItemsSelected
strItemList = strItemList & ", " & ctrl.ItemData(varItem)
Next varItem
' remove redundant leading comma and space
strItemList = Mid(strItemList, 3)
' fill text box with list
Me.txtYourTextBox = strItemList
Else
MsgBox "No items selected.", vbInformation, "Warning"
End If
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.