AOB
Registered User.
- Local time
- Today, 18:02
- Joined
- Sep 26, 2012
- Messages
- 623
Hi guys,
This is a fairly basic problem so I'm disappointed with myself that I haven't been able to figure it out with a simple search!
I have a simple listbox (single column, no multi-selection)
I want to enable a command button when the user selects an item in the listbox / disable it if no items are selected.
I'm using the AfterUpdate event of the listbox, as follows :
But when I select an item from the listbox, and debug the code, the Count is always zero? Even though I can see the item selected??
What am I doing wrong?
(Like I say, extremely disappointed with myself here, this is basic stuff! :banghead
Thanks
Al
This is a fairly basic problem so I'm disappointed with myself that I haven't been able to figure it out with a simple search!
I have a simple listbox (single column, no multi-selection)
I want to enable a command button when the user selects an item in the listbox / disable it if no items are selected.
I'm using the AfterUpdate event of the listbox, as follows :
Code:
Private Sub lstOptions_AfterUpdate()
Select Case Me.lstOptions.ItemsSelected.Count
Case 0
Me.comConfirm.Enabled = False
Case Else
Me.comConfirm.Enabled = True
End Select
End Sub
But when I select an item from the listbox, and debug the code, the Count is always zero? Even though I can see the item selected??
What am I doing wrong?
(Like I say, extremely disappointed with myself here, this is basic stuff! :banghead

Thanks
Al