Make text box invisible

E

eb1mom

I am trying to make a text box in a subform not visble
based on value in text box on main form. The value in main
form text box will be a 7 character alpha numeric code, if
it ends with B, I would like subform text box not visible.
I have this in Onload of main form and it doesn't work.
Any suggestions would be appreciated.

If Me.name of the main form field = " ******B" then
Forms![name of main form]![name of subform]![name of the
field in the subform] .visible=False
 
S

Scott McDaniel

Try putting this in the Form Current event:

Me.NameOfYourSubformCONTROL.Form.SubFormTextBox.Visible =
UCase(Right(Me.YourMainFormField,1)) = "B"

Note that where most people get tripped up is the NameOfYourSubformCONTROL.
The subform control is simply a control, just like a textbox, and is
normally named something like Child12. The .SourceObject is the name of the
form that the subform control displays.
 
E

eb1mom

Thanks for your time. Text box is now not visible. I
appreciate your help.
-----Original Message-----
Try putting this in the Form Current event:

Me.NameOfYourSubformCONTROL.Form.SubFormTextBox.Visible =
UCase(Right(Me.YourMainFormField,1)) = "B"

Note that where most people get tripped up is the NameOfYourSubformCONTROL.
The subform control is simply a control, just like a textbox, and is
normally named something like Child12. The .SourceObject is the name of the
form that the subform control displays.

I am trying to make a text box in a subform not visble
based on value in text box on main form. The value in main
form text box will be a 7 character alpha numeric code, if
it ends with B, I would like subform text box not visible.
I have this in Onload of main form and it doesn't work.
Any suggestions would be appreciated.

If Me.name of the main form field = " ******B" then
Forms![name of main form]![name of subform]![name of the
field in the subform] .visible=False


.
 

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