Setting text box visibility

  • Thread starter Thread starter Justin
  • Start date Start date
J

Justin

I am trying to set the visibility of a text box according to the value
in a combo box.

In other words, I would like for textbox1 to be visible when combobox1
value = 60, otherwise textbox1 should not be visible.

Any help will be greatly appreciated.
 
You will want this code in the After Update event of the combo box, as
well as the On Current event of the form i believe (if you need to set
visibility when changing records)


If Me.Combo1 = 60 Then
Me.Text1.Visible = True
Else
Me.Text1.Visible = False
End If
 
You will want this code in the After Update event of the combo box, as
well as the On Current event of the form i believe (if you need to set
visibility when changing records)

If Me.Combo1 = 60 Then
     Me.Text1.Visible = True
Else
     Me.Text1.Visible = False
End If

Thanks. I found, accidentally, that putting this code only in the On
Current event of the form works.
If I want to evaluate several values for the same text box, would I
need to have multiple IF statements? Also, the combo box can have
values such as "84A, 84B, etc. Can I have a wildcard to show the
textbox if the value contains any instance of a particular number?
 
Thanks. I found, accidentally, that putting this code only in the On
Current event of the form works.
If I want to evaluate several values for the same text box, would I
need to have multiple IF statements? Also, the combo box can have
values such as "84A, 84B, etc. Can I have a wildcard to show the
textbox if the value contains any instance of a particular number?


The combo box values are "text" as opposed to numbers. I didn't know
if this would be an issue or not.
Thanks again for you help and for any other help you can offer.
 
Back
Top