General discussion
June 24, 2005 at 06:21 PM
rich-having. fun.

Set Visible property Question

by rich-having. fun. . Updated 21 years, 3 months ago

I need to make a text box visible or invisible depending upon the value of a combo box on my form.
I have a combo box with 2 values Cable and wireless. When cable is selected, I need a text box named cable visible and text box named Wireless not visible, and vice versa. I have tried for a bit with the following code:
If ([Wireless or Cable] = “Cable”) Then txtCableQ2.IsVisible = True
If ([Wireless or Cable] = “Cable”) Then txtCableQ3.IsVisible = True
If ([Wireless or Cable] = “Cable”) Then txtCableQ4.IsVisible = True
Else
If ([Wireless or Cable] = “Wireless”) Then Set txtCableQ1.IsVisible = False
If ([Wireless or Cable] = “Wireless”) Then Set txtCableQ2.IsVisible = False
If ([Wireless or Cable] = “Wireless”) Then Set txtCableQ3.IsVisible = False
If ([Wireless or Cable] = “Wireless”) Then Set txtCableQ4.IsVisible = False

End If
End Sub

Is there an easier way to do this, or what am I missing in my code?

This discussion is locked

All Comments