marle35
Programmer
- Jul 17, 2007
- 36
I am using Access 2000. I have a single-selection listbox in a form, and I am able to access the selected value, but only at a later point like when a button is pressed. In the the AfterUpdate event for the listbox, the event fires but when I try to access the selected value, I get "Run-time error 2480: you referred to a property by a numeric argument that isn't one of the property numbers in the collection." I need to access the value when the item is selected, it's highly important. This code gives the basic idea:
Private Sub lstType_AfterUpdate()
MsgBox (lstType.ItemData(lstType.ItemsSelected(0)))
End Sub
What might be going wrong?
Private Sub lstType_AfterUpdate()
MsgBox (lstType.ItemData(lstType.ItemsSelected(0)))
End Sub
What might be going wrong?