I have a multi select list box (simple), and want to push selections to another list box (value list) through AddItem code behind a command_click event.
I can do this for items selected when it is not a multi select list
(I am also trying to get multiple columns for each record copied across.)
When I try and add "for each ..." logic, it only copies one record into the listbox?
What am I missing?
I can do this for items selected when it is not a multi select list
Code:
Dim ItemIndex As Variant
For Each ItemIndex In Me.List18.ItemsSelected
Me.List22.AddItem (Me.List18.Column(0) & ";" & Me.List18.Column(1))
Next
(I am also trying to get multiple columns for each record copied across.)
When I try and add "for each ..." logic, it only copies one record into the listbox?
Code:
Dim valSelect As Variant
Dim strValue As String
For Each valSelect In Me.List18.ItemsSelected
strValue = strValue & "'" & Me.List18.ItemData(valSelect) & "'; "
Next valSelect
Me.List22.AddItem strValue
What am I missing?