Hi All
I have a listbox on my Form that is called lstEvents.
What I want is to click the item in the list box and return the value of the first column for the item i have selected.
The following code doesnt work with an On Click event on the list box but it does work for On Double Click Event on the list box:
Please see below
Doesn't Work: I need the below to work.
Does Work:
I have a listbox on my Form that is called lstEvents.
What I want is to click the item in the list box and return the value of the first column for the item i have selected.
The following code doesnt work with an On Click event on the list box but it does work for On Double Click Event on the list box:
Please see below
Doesn't Work: I need the below to work.
Code:
Private Sub lstEvents_Click()
MsgBox Me.lstEvents.ItemData(Me.lstEvents.ItemsSelected(i))
End Sub
Does Work:
Code:
Private Sub lstEvents_DblClick(Cancel As Integer)
MsgBox Me.lstEvents.ItemData(Me.lstEvents.ItemsSelected(i))
End Sub