PDA

View Full Version : VBA Access Hide Subform, Box


skokie
Oct 6, 2007, 10:08 PM
Hello all,
I'm trying to create an application using access VBA. Unfortunately, I'm a novice programming in VBA. I'd like to know the VBA code to hide and show a subform or a box created in a form.

Thanks

Sean

ScottGem
Oct 7, 2007, 01:31 AM
Every control on a form has a Visible property. Setting this property to No hides the control, setting it Yes displays it. So the line:

Me.subformname.Visible = No

would hide it. If you are looking to hide subforms, though, I would consider using a Tab control. A hidden subform will leave a big blank space on your form and that will look unprofessional. By organizing the subform in a tab control, you can hide the tab control page that the subform is on without leaving a gaping hole on the form.

P.S. if you want to learn VBA programming, you might find this of interest:
Amazon.com: Microsoft Office Access 2007 VBA (Business Solutions): Books: Scott B. Diamond (http://www.amazon.com/Microsoft-Office-Access-Business-Solutions/dp/0789737310/ref=sr_1_1/103-2244950-0673424?ie=UTF8&s=books&qid=1191447743&sr=8-1)