Hi,
I need some help regarding combo box in VBA. In my userform, i have three fields, 1.combo box; 2&3 (Combo box and label field).
By default, in user initialize, field 2 &3 are invisible
1. Combo box have two items : yes and No
2. if we select yes from combo box, then another text box and combo box should be visible
i wrote the code but not working properly. if i select yes from combo box, it become visible but if i select no, its not disappearing.
your help will be highly appreciated.
Private Sub CBStradd_Change()
If CBStradd.RowSource = "No" Then
Me.Label27.Visible = False
Me.CBstrtadd.Visible = False
Else
Me.Label27.Visible = True
Me.CBstrtadd.Visible = True
End If
End Sub
I need some help regarding combo box in VBA. In my userform, i have three fields, 1.combo box; 2&3 (Combo box and label field).
By default, in user initialize, field 2 &3 are invisible
1. Combo box have two items : yes and No
2. if we select yes from combo box, then another text box and combo box should be visible
i wrote the code but not working properly. if i select yes from combo box, it become visible but if i select no, its not disappearing.
your help will be highly appreciated.
Private Sub CBStradd_Change()
If CBStradd.RowSource = "No" Then
Me.Label27.Visible = False
Me.CBstrtadd.Visible = False
Else
Me.Label27.Visible = True
Me.CBstrtadd.Visible = True
End If
End Sub