[求助]vb 请指点怎样做关联的下拉菜单?
我用了两个COMBOBOX,给COMBOBOX1赋值为A和B,想在选A的时候COMBOBOX2赋值为1,2,3 选B的时候COMBOBOX2赋值为4,5,6。怎样实现? Private Sub C1_Click()
If COMBOBOX1.Text = "A" Then
Me.COMBOBOX2.AddItem ("1")
Me.COMBOBOX2.AddItem ("2")
Me.COMBOBOX2.AddItem ("3")
Else
If COMBOBOX1.Text = "B" Then
Me.COMBOBOX2.AddItem ("4")
Me.COMBOBOX2.AddItem ("5")
Me.COMBOBOX2.AddItem ("6")
End If
End If
End Sub
原先我用上面代码,结果反复选A,B的时候,就在COMBOBOX2出现了N多的1,2,3,4,5,6。怎样才能解决?