A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting text box visibility



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2009, 09:22 PM posted to microsoft.public.access.forms
Justin
external usenet poster
 
Posts: 27
Default Setting text box visibility

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.
  #2  
Old October 13th, 2009, 09:31 PM posted to microsoft.public.access.forms
ghetto_banjo
external usenet poster
 
Posts: 325
Default Setting text box visibility

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



  #3  
Old October 22nd, 2009, 12:50 PM posted to microsoft.public.access.forms
Justin
external usenet poster
 
Posts: 27
Default Setting text box visibility

On Oct 13, 4:31*pm, ghetto_banjo wrote:
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?
  #4  
Old October 22nd, 2009, 01:23 PM posted to microsoft.public.access.forms
Justin
external usenet poster
 
Posts: 27
Default Setting text box visibility

On Oct 22, 7:50*am, Justin wrote:
On Oct 13, 4:31*pm, ghetto_banjo wrote:

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?



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.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.