"Sally" <sm*****@earthl ink.net> wrote in message
news:fT******** ********@newsre ad2.news.atl.ea rthlink.net...
In a simple multiselect listbox, what is the code to return an item's
index when it is selected?
Thanks!
Sally
I am not sure I completely understand the question, but there are 3
properties that could be used depending upon what you want to accomplish:
Use the ListIndex property to figure out WHERE the selected item is:
Dim currentPosition As Integer
currentPosition = (lstIncSrch.Lis tIndex + 1)
Use the Selected property to determine IF the item is selected:
for x = 1 to listBoxName.Lis tCount - 1
if listBoxName.Sel ected(x) = False then
msgbox("Yeah, it's selected!!!)
end if
next x
Use the ItemData property to return the VALUE of the item at that location
selectedItem = lstIncSrch.Item Data(currentPos ition)