Solo712
Registered User.
- Local time
- Today, 18:45
- Joined
- Oct 19, 2012
- Messages
- 828
I don't know whether this has been discussed on this or the VBA forum (I have not found any reference) but my single-select listbox (i.e. Multiselect property set to 'None') in Access 2007 drives me to distraction. I have tried everything but can't find a simple solution to reading out the single selection from the list. I have tried to read the collowing code trapped by OnClick and AfterUpdate events but it shows nothing was selected:
The code passes right through the items in the Listbox as if no selection was made. The 'CondoList.ItemsSelected.Count' shows a fat zero. Never had this problem with Multiselect !
The strangest thing is that if I query the listbox later (I created a radio button to confirm the new selection as a workaround) then it correctly identifies the selected item. Is this a bug or am I missing something ? I have tried just about everything. Many thanks for your help.
Best,
Jiri
Code:
For i = 0 To CondoList.ListCount - 1
If CondoList.Selected(i) Then
If i <> glbCondoID - 1 Then
'...........change the current selected condo to manage
End If
End If
Next i
The code passes right through the items in the Listbox as if no selection was made. The 'CondoList.ItemsSelected.Count' shows a fat zero. Never had this problem with Multiselect !
The strangest thing is that if I query the listbox later (I created a radio button to confirm the new selection as a workaround) then it correctly identifies the selected item. Is this a bug or am I missing something ? I have tried just about everything. Many thanks for your help.
Best,
Jiri