M
Memento
Hello Guys,
I'm trying to copy from a listbox to a listbox on a form. The first listbox
contains hardware items (manufacturer, model, type and serial), 4 columns,
based upon a query. The second listbox is bound to a textfield
(coupled_hardware) in a users table, so I can 'couple' hardware items to
users.
However my code doesn't work as supposed to. When i doubleclick on an item,
i only see the columnheads change on the second listbox into the
manufacturer, and nothing gets added to my listbox. I'm not getting any
errors further. The code:
Private Sub lstHardware_DblClick(Cancel As Integer)
Dim strItem As Variant
Dim intCurrentRow As Integer
For intCurrentRow = 0 To lstHardware.ListCount - 1
If lstHardware.Selected(intCurrentRow) Then
strItem = lstHardware.Selected(intCurrentRow)
lstHardwareUser.AddItem (strItem)
End If
Next intCurrentRow
lstHardwareUser.RowSource = ""
lstHardwareUser.RowSource = strItem
End Sub
Thanks in advance,
Memento
I'm trying to copy from a listbox to a listbox on a form. The first listbox
contains hardware items (manufacturer, model, type and serial), 4 columns,
based upon a query. The second listbox is bound to a textfield
(coupled_hardware) in a users table, so I can 'couple' hardware items to
users.
However my code doesn't work as supposed to. When i doubleclick on an item,
i only see the columnheads change on the second listbox into the
manufacturer, and nothing gets added to my listbox. I'm not getting any
errors further. The code:
Private Sub lstHardware_DblClick(Cancel As Integer)
Dim strItem As Variant
Dim intCurrentRow As Integer
For intCurrentRow = 0 To lstHardware.ListCount - 1
If lstHardware.Selected(intCurrentRow) Then
strItem = lstHardware.Selected(intCurrentRow)
lstHardwareUser.AddItem (strItem)
End If
Next intCurrentRow
lstHardwareUser.RowSource = ""
lstHardwareUser.RowSource = strItem
End Sub
Thanks in advance,
Memento