Show the value of a multi-select list box selection

B

BruceM

I have the following code (adapted from Allen Browne) to loop through items
selected in a multi-select list box and add them to a collection:

Dim varItem As Variant
Dim colAB As New Collection

lngParent = Me.SessionID

'Loop through the items Selected in the list box.
With Me.lstAttendees
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
colAB.Add .ItemData(varItem)
Debug.Print .ItemData(varItem)
End If
Next
End With

The list box Row Source is EmployeeID, FullName (concatenated field)

The bound column is 1, so ItemData is the EmployeeID. How can I get
Debug.Print to show the second column (Column(1)? Debug.Print .Column(1)
shows only the last name selected. If three names were selected it shows
the third name three times.

This code as posted does not do anything. I'm just doing some
experimentation, and trying to figure out the syntax needed.
 

Ask a Question

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.

Ask a Question

Top