• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

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.
0
mcollins354
Asked:
mcollins354
1 Solution
 
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
 
mcollins354Author Commented:
Excellent!  This is exactly what I needed and it worked great.  Thank you!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now