M
M Skabialka
I have a ListBox called lstInventory, with two columns, a text value, and
the ID primary key for that value. When I click an item in the listbox I
would like to use that value to display details about that record based on
the ID. This code never shows any item as selected, i.e.
lstInventory.Selected(i) is always false - what is wrong with the code?
Private Sub lstInventory_Click()
Dim i As Integer
i = -1
Do Until i = Me.lstInventory.ListCount
i = i + 1
If lstInventory.Selected(i) Then Me!InventoryIDSelect =
Me.lstInventory.Column(1, i)
Loop
End Sub
the ID primary key for that value. When I click an item in the listbox I
would like to use that value to display details about that record based on
the ID. This code never shows any item as selected, i.e.
lstInventory.Selected(i) is always false - what is wrong with the code?
Private Sub lstInventory_Click()
Dim i As Integer
i = -1
Do Until i = Me.lstInventory.ListCount
i = i + 1
If lstInventory.Selected(i) Then Me!InventoryIDSelect =
Me.lstInventory.Column(1, i)
Loop
End Sub