Setting text box visibility

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.
 
G

ghetto_banjo

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
 
J

Justin

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?
 
J

Justin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top