Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004

    Exclamation Unanswered: Change Combos :-0

    Hi again this time I would like to know how to:

    If I have 2 combos for example,

    cbo1--> a

    How could I make it that the second combo would change depending on what one was selected in cbo2

    so if cbo1 was a then cbo2 would display d and e and if cbo1 was b then cbo2 would display f and g

    Hope I explained ok,

    Thanks in advance


  2. #2
    Join Date
    Jul 2004
    hi! hope this simple code will give you an idea...(i created two comboboxes then in the Form Load event, i set their items. hope i got your question right.)

    Private Sub Combo1_Click()
    Combo2.ListIndex = Combo1.ListIndex
    End Sub

    Private Sub Form_Load()
    With Combo1
    .AddItem "A"
    .AddItem "B"
    End With

    With Combo2
    .AddItem "D , E"
    .AddItem "F, G"
    End With
    End Sub

  3. #3
    Join Date
    Aug 2004
    Sadly no but it was probably me not setting it out right. If combo 1 = "A" then I want combo2 = "B" and "C". If combo1 = "D" then i want combo2 = "E" and "F. If thats what you mean and I just f**ked it up then I will aid you with real life examples!

    Thanks for the help

  4. #4
    Join Date
    Jan 2004
    Aberdeen, Scotland
    I can look into this later on but what you need to do is look at the value of the combo box when the SelectedIndex Changes
    produce a select case on the value of combo1
    empty combo2 and refill combo 2 with the correct results

Posting Permissions

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