0
votes

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

2 Answers

1
votes

Try This

Call combo2.Clear

Or this

Dim i As Integer
For i = 1 To ComboBox2.ListCount
    ComboBox2.RemoveItem (0)
Next i
0
votes

This works

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