B
bwion
Hey All,
I seem to be having trouble with something that seems pretty routine. I have
one listbox (multi-column) that has Multi-Select enabled and it is based off
a query. I want to be able to select items from that listbox and then click a
command button and it transfers the items that I selected from that listbox
to another listbox (multi-column as well). The listbox columns will contain
the same information too. Here is what I am trying in the command button's
click event procedure with no luck:
Dim i As Integer
If Me.lstCSRItems.ListIndex = -1 Then Exit Sub
For i = Me.lstCSRItems.ListCount - 1 To 0 Step -1
If Me.lstCSRItems.Selected(i) = True Then
Me.lstSRItems.AddItem
Me.lstCSRItems.Column(0,i);Me.lstCSRItems.Column(1,i);Me.lstCSRItems.Column(2,i);Me.lstCSRItems.Column(3,i);Me.lstCSRItems.Column(4,i);Me.lstCSRItems.Column(5,i);Me.lstCSRItems.Column(6,i)
End If
Next i
The AddItem method only seems to want to work with hardcoded strings. Any
thoughts on how I can add items to a multi-column listbox? Thanks in advanced
for the help.
Ben Wion
I seem to be having trouble with something that seems pretty routine. I have
one listbox (multi-column) that has Multi-Select enabled and it is based off
a query. I want to be able to select items from that listbox and then click a
command button and it transfers the items that I selected from that listbox
to another listbox (multi-column as well). The listbox columns will contain
the same information too. Here is what I am trying in the command button's
click event procedure with no luck:
Dim i As Integer
If Me.lstCSRItems.ListIndex = -1 Then Exit Sub
For i = Me.lstCSRItems.ListCount - 1 To 0 Step -1
If Me.lstCSRItems.Selected(i) = True Then
Me.lstSRItems.AddItem
Me.lstCSRItems.Column(0,i);Me.lstCSRItems.Column(1,i);Me.lstCSRItems.Column(2,i);Me.lstCSRItems.Column(3,i);Me.lstCSRItems.Column(4,i);Me.lstCSRItems.Column(5,i);Me.lstCSRItems.Column(6,i)
End If
Next i
The AddItem method only seems to want to work with hardcoded strings. Any
thoughts on how I can add items to a multi-column listbox? Thanks in advanced
for the help.
Ben Wion