Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through listbox selecting second column values? 1

Status
Not open for further replies.

glgcag

MIS
Apr 25, 2001
160
US
I have a listbox that is multiselect. As I'm grabbing the keys in the first column, I want to grab the descriptions in the second column to cram into a string for display purposes.

Here's the code to grab the first column:
Code:
    For Each varItem In Me.lstOtherCriteria.ItemsSelected
        sID = sID & Me.lstOtherCriteria.ItemData(varItem) & ";"
    Next varItem

Since this code only grabs the first column data, is it possible to use a reference to the second column to get at it's information, to the effect of:
Code:
me.lstOtherCriteria.ItemData(varItem).Column(1)

I know this code won't work, because it won't recognize the "Column(1)" after the itemdata property and it errors out. Not sure how to make it work, even if it's possible . . .

Any help is appreciated!
 
Have you tried this ?
sID = sID & Me.lstOtherCriteria.Column(1, varItem) & ";"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
AWESOME! It's these little things that drive me nuts and you nailed it right out of the box! THANK YOU!

glgcag
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top