Using Command Buttons to show/hide subforms on a Form

I have a form, called FormA, with subforms: SubFormB1 and SubFormB2.  Here is what I would like to do:

I would like to have two buttons, ButtonB1 and ButtonB2 on the FormA.  When pressed, they would open the respective Subforms.  So, when I push ButtonB1, SubformB1 would open.

The only catch is: these buttons reside on FormA always.  The subforms open on FormA.  So the buttons would open and hide the other subform.  

To possible give a better visual, I imagine this to be (somewhat) like a webpage (FormA) with navigation links along the side (ButtonB1 and ButtonB2) that open contens in a frame (SubFormB1 and SubFormB2) without changing the overall page itself (FormA)

Any help is greatly greatly appreciated.
mcollins354Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
If you place the subforms one on top of the other then you can make them visible or not.
You must use the name of subform container control in each case. That might be the same as the name of the subform but it could be different, so you have to check.


ButtonA:
me.containercontrolB.visible = false
me.containercontrolA.visible = true

ButtonB:
me.containercontrolA.visible = False
me.containercontrolB.visible = True
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcollins354Author Commented:
Excellent!  This is exactly what I needed and it worked great.  Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.