Jen T
asked on
Access VBA - selected Item in Listbox (multiselect) - value of ONE item selected
hi there,
I couldn't find the answer and nothing I've tried worked so here goes.
I have a multi-select listbox on my form. I know how to go through the selected items (through a for loop) and retrieve the values of the selected items. But i have an if else statement that goes:
if items_Selected > 1 then
do. some things
else (if item selected is 1) then
retrieve whatever was selected - just the one value and then do some stuff!
I can't figure out how to retrieve whatever was selected when it's just one.
Do I have to go through a loop?
I've tried: Me.lstStuff.ItemData, Me.lstStuff.ItemsSelected even Me.lstStuff.Value and nothing worked :(.
Please help and thank you.
I couldn't find the answer and nothing I've tried worked so here goes.
I have a multi-select listbox on my form. I know how to go through the selected items (through a for loop) and retrieve the values of the selected items. But i have an if else statement that goes:
if items_Selected > 1 then
do. some things
else (if item selected is 1) then
retrieve whatever was selected - just the one value and then do some stuff!
I can't figure out how to retrieve whatever was selected when it's just one.
Do I have to go through a loop?
I've tried: Me.lstStuff.ItemData, Me.lstStuff.ItemsSelected even Me.lstStuff.Value and nothing worked :(.
Please help and thank you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.