Results 1 to 3 of 3

Thread: 2 combo boxes

  1. #1

    Thread Starter
    Registered User
    Join Date
    Sep 2002
    Posts
    221

    2 combo boxes

    i have to combo boxed, in the first 1 i have around 5 items. In the second i have 0 items. how do i add items to the second combo box after selecting an item from the first 1

    eg

    if I select 1 from the first combobox, i want a, b, and e to be added to the second combo box which are not viewable until I click on the drop down button?

  2. #2
    Addicted Member Renee K's Avatar
    Join Date
    Jun 2002
    Posts
    163
    Not sure if this is exactly what your looking for

    Code:
    Private Sub Form_Load()
        With Combo1
            .AddItem "Hello"
            .AddItem "How"
            .AddItem "Are"
            .AddItem "You?"
        End With
    End Sub
    
    Private Sub Command1_Click()
        Combo2.AddItem Combo1.Text
    End Sub
    .·*¨) ¸.·*¨) ¸.·*¨*
    (¸.*´ ¸.·´*'~*Renee~* (¸.*´~*



    Funny how the little things can stop you dead in your tracks.

  3. #3

    Thread Starter
    Registered User
    Join Date
    Sep 2002
    Posts
    221
    I want items to be added to combo2 at runtime

    e.g.

    VB Code:
    1. if combo1.text = "1" then
    2.     combo2.additem "a"
    3.     combo2.additem "b"
    4.     combo2.additem "c"
    5. elseif combo1.text = "2"
    6.     combo2.additem "x"
    7.     combo2.additem "y"
    8.     combo2.additem "z"
    9. elseif combo1..................... and so on

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width