0

I have two comboboxes they are sync each other. After selecting first combobox value and then corresponding values will display in 2nd combobox . Each time when i select first combo box then previously reselected 2nd combo value should be clear. I'm using below code in the OnChange event of first combo1.But it is not working.

             Private Sub combo1_Change()
             Me.combo2.RowSource = ""
             End Sub

2 Answers 2

1

Try This

Call combo2.Clear

Or this

Dim i As Integer
For i = 1 To ComboBox2.ListCount
    ComboBox2.RemoveItem (0)
Next i
2
  • .Clear Method not available
    – vuyy1182
    Feb 20, 2014 at 20:44
  • Maybe its not showing in the intellisence but its defiantly there. I've also brought another method you could use
    – Math4123
    Feb 20, 2014 at 20:47
0

This works

      Private Sub combo1_Change()
      Me.combo2.Value = ""
      End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.