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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select column 1 in 1 lbox by selecting column 2 in second lbox

Status
Not open for further replies.

Frank72

Technical User
Nov 13, 2001
57
IE
hows it going

i have 1 double column listbox (bound column = 1) but want to fill a message box with the same selection only the other column 1 being a franchise ID and the other being franchise name. i've tried using an invisible copy of the lbox and listbox.selected(count) to select the equivelant value in the invisible copy, i set the the bound column of second lbox to 2 but the selected property seems to keep the selection of the column aswell as the row

any ideas?

thanks alot

frank
 
Hi Frank!

You can do this with one list box:

Dim i As Integer

For i = 0 To ListBox.ListCount - 1
If ListBox.Selected(i) = True Then
Call MsgBox(ListBox.Column(1, i)
End If
Next i

If your list box will allow only one selection then you can use the ListIndex property instead of the loop above.

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top