Form/Subform

jakoBAlmqvist

Registered User.
Local time
Today, 14:24
Joined
Jun 27, 2005
Messages
26
Is it possible to in a form have some buttons and depending on which button you push a different subform will be displayed?

For the moment I have buttons that opens entire forms that are almost the same but with different subforms. But it feels wrong to do it this way?

-jake
 
Have you thought about using the 'Tabbed Control' option. This allows several subforms to be available on one main form without the need for multiple buttons. Each tabbed control can contain several subforms, if necessary.

See the Help info.

HTH

Dave Eyley
 
Thanks Dave! I hade totaly forgotten about it! This is better then having all those buttons...

-jake
 
Multiple subforms...

This may be posted too late to help you this time, as it sounds you already have a solution. However, I created the attached example for a coworker who was having what sounds like a similar problem.

The key to what you wanted is:

Forms!YourMainForm!YourSubForm.SourceObject = "YourNextSubForm"

Put it in a function, with the appropriate names of your objects, and then call the function on a button click, or on some other appropriate event; Lost Focus, Mouse Up, etc.

Note: The attached db is a very basic example and would need error trapping and the like added before going into a production environment.
 

Attachments

Users who are viewing this thread

Back
Top Bottom