multi listbox control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    multi listbox control

    i have three list boxes and want to know how i can choose from one listbox and have the others fill in with information example:

    in the first listbox if it is loaded with names and i click on one. then in the second listbox would produce an age and the third listbox height.

    but i tried with an if statement but it didn't work example:

    first listbox:

    Code:
    if listbox1.text = "Frank" then
        listbox2.additem 35
        listbox3.additem 5'11
    end if
    but as you probably know this doesn't work how can i get this to work?

    lee123
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    More along the lines of this...
    Code:
    Private Sub List1_Click()
    Dim I As Integer
    For I = 0 To List1.ListCount - 1
      If List1.List(I) = "Frank" Then
        '...
      End If
    Next I
    End Sub


    Good Luck

    Comment

    Working...