Using a cmd button to change a subform

Johnny Drama

In need of beer...
Local time
Yesterday, 18:22
Joined
Dec 12, 2008
Messages
211
Is it possible to use a command button to change between subforms on a form? Example, the primary form has subform1 displayed in the lower part of the form. User clicks a command button and subform1 gets switched out with subform2
 
Yes it is possible, but why not just create a Tab control with two tabs and put one sub form on each tab?
 
Client doesn't want tabs for whatever reason. Go figure...
 
Okay...I've been trying to figure out how to do this, but can't get it. The client wants a form with several buttons across the top of the primary form. When they click on any of those buttons they want the associated sub form to appear down below the buttons on the top. ie. buttons across the top of the form are button 1, button 2, button 3. When button 1 is clicked it will open subform 1, when button 2 is clicked it will open subform 2, etc., without leaving the original form.

Any thoughts on how I can achieve this?
 
If you use a tab control the tabs can be displayed to look like buttons.

If you don't use a tab control I would suggest that you will need to place your subforms on top of each other and and set their visible property to false. When the main form opens you could make one of the visible. The code for each button would have to show the required subform and hide the rest. Lots of code and not so easy to work with. Tab control is surely the way to go.
 

Users who are viewing this thread

Back
Top Bottom