multiple sub forms (1 Viewer)

ilanray

Member
Local time
Today, 18:25
Joined
Jan 3, 2023
Messages
116
Hello
I would like to create a form with 3 or more sub forms
I don't want to use the control tab since it has few problems

Any ideas? maybe an database example?

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:25
Joined
Oct 29, 2018
Messages
21,491
Have you considered using a Navigation Form?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:25
Joined
Feb 19, 2002
Messages
43,331
I don't want to use the control tab since it has few problems
It isn't the tab control that has issues. It is the navigation form;)

What problem are you trying to avoid?
 

Mike Krailo

Well-known member
Local time
Today, 11:25
Joined
Mar 28, 2020
Messages
1,044
Since you haven't given us much to go on in the way of specifics, this will turn out to be a guessing game thread. Have a look at this example which has multiple sub forms that are joined via a union query. Filter Sub Forms by Month and Date
 

ilanray

Member
Local time
Today, 18:25
Joined
Jan 3, 2023
Messages
116
Ok sorry about that. I have few forms and I would like to create a menu that every button open a speific form
 

Edgar_

Active member
Local time
Today, 10:25
Joined
Jul 8, 2023
Messages
432
Ok sorry about that. I have few forms and I would like to create a menu that every button open a speific form
The navigation form does that. It's also very easy to use.

@Pat Hartman should clarify what issue she sees with it. I've been using the control extensively recently and I've encountered no problems. Attached a sample.
navigation subform ms access
 

Attachments

  • navigation_control.accdb
    588 KB · Views: 68

isladogs

MVP / VIP
Local time
Today, 16:25
Joined
Jan 14, 2017
Messages
18,246
Although I don't use the built-in navigation form, I use my own custom version of the navigation form and find it works very well.
Much easier to code and with far fewer issues than the tab control.

For example, automatic form resizing works fine with a navigation-type form but can be problematic with a tab control.
This video shows one example of how I use it:

 

Auntiejack56

Registered User.
Local time
Tomorrow, 01:25
Joined
Aug 7, 2017
Messages
175
Hi,
Solely for the sake of providing a range of examples, this is a button controlled series of subforms. It is all roll-your-own, and there are problems with that, the main one being that I am stuck with 5 buttons unless I rewrite a heap of stuff.
On the plus side, the users wanted the big graphics, and they find it very easy to use and also easy to train newbies.
The actual putting together is fairly simple: 10 graphics for the buttons, and a white vertical line that you move adjacent to each button to make the tab integrate with the subform.
The app itself sends and receives SMS messages.

MenuScreenshot.png


It is also easy to integrate the more complex stuff like Admin, which has 10 of its own subforms.

AdminScreenshot.png


I'm not recommending you go this way. But you asked for examples, so presto!

Jack
 

Mike Krailo

Well-known member
Local time
Today, 11:25
Joined
Mar 28, 2020
Messages
1,044
@Pat Hartman should clarify what issue she sees with it. I've been using the control extensively recently and I've encountered no problems. Attached a sample.
I'm not sure about her exact reason, but there is the issue of not being able to interact between controls on different forms when using a Navigation control due to the fact that each form/subform is closed when navigating to each one. That isn't the case with tab controlled items, and that is a design factor to consider. I've heard of issues with flickering problems on tab controls that do not occur on navigation forms, so each one has it's advantages and disadvantages.
 

isladogs

MVP / VIP
Local time
Today, 16:25
Joined
Jan 14, 2017
Messages
18,246
One of the main advantages of navigation style forms is the fact that only one subform is ever in use at a time.
As already mentioned, I don't use the built-in version as I've had issues with that over the years, but the principle behind it is sound.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:25
Joined
Feb 19, 2002
Messages
43,331
@Pat Hartman should clarify what issue she sees with it. I've been using the control extensively recently and I've encountered no problems. Attached a sample.
I haven't found any bugs per se. I just don't like the way it works. Although the following image is probably just sloppy design which I might be able to fix if I had to use the form. This is out f the box. The tabs across the top show the dark version when selected but the tabs on the left show the light version. So, it looks like the selected form is Menu 1/Instructions but it is Menu 1/Report. The selection is of course more obvious when you have more than two items since you'll have one item of one color and the others will be the alternate color. But I find it confusing to have the selected "across" color be different from the "down" color. Call me crazy but it grabbed me immediately when I built this form. I haven't actually built a navigation form since 2007 and it was only once that I committed to it. I never used it again.
1694451300949.png

1.. It is not data bound. That means inserting or resequencing the items is a royal PITA.
2.. It doesn't nest the way the old switchboard does so you are limited to what you can fit on one page- Across and down so x * y is the limit. Old versions of the form did not allow you to embed a navigation form onto a navigation form. I did it by accident and it seems to work but I didn't test thoroughly. This would seem to solve the problem of needing a more hierarchical menu system.
3.. You have to remember to make any form references in queries reference a subform on the navigation form so adding after the fact could cause you to have to change a bunch of queries if you are inclined to use form field references as I do.
4.. Only one form is ever loaded at one time so no subform can refer to a different subform. This is actually a pro for the way the form works since most of the time the subforms would not need to refer to each other

I like the look of the form but when I want the look, I can roll my own. The code is trivial when the menus are data bound. You also have the option of using images for the buttons. But the big benefit is you can use the same technique the old switchboard uses to nest menus. That gives you a better control over how the interface is organized.

For small applications, nothing matters, including this. It is the larger applications where you ultimately feel constrained by the navigation form.

I don't want to talk you out of using the navigation form. It is pretty easy to use out of the box (except for the nails on the blackboard issue in the picture above). Maybe it doesn't bother you. Maybe you never even noticed. If your app is limited to two dimensions for options, it will be fine.
 
Last edited:

Edgar_

Active member
Local time
Today, 10:25
Joined
Jul 8, 2023
Messages
432
The tabs across the top show the dark version when selected but the tabs on the left show the light version
:unsure: I pressed F12 and used the browser's color picker, the color palette of both top/left are the same.
It is not data bound.
Yeah, that sucks, unless...

you are limited to what you can fit on one page- Across and down so x * y is the limit
Just an idea you could use for fun if you feel bored one day:
1. Add a bunch of buttons to the navigation form.
2. Give them array-friendly names like button1, button2, etc.
3. Using a global state variable like Tempbars, change what each button does according to the state and you'll have infinite options.
Another idea for a lazy afternoon:
Embed multiple vertical/horizontal menu layouts into other vertical/horizontal menu layouts

I believe Navigation Forms are excellent because they align with the typical user interface and user experience found on web platforms. Most apps probably won't need so many menu items that fill the entire screen in two dimensions anyway. It's important to remember that, as apps get larger, everything becomes more complex, including menus and including queries and most things. So, in my opinion, the Navigation Form is a great choice for most uses.

I've heard of issues with flickering problems on tab controls that do not occur on navigation forms
I know what you mean, but I've seen the same problem applies to tab controls, buttons and also anything that uses a theme. Access in general has a bug with themes, which is why when I'm going to use them I always preload the theme and color palette with VBA, to ensure it does not gets washed out out of the blue (that is the bug, all color references become White).
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:25
Joined
Feb 19, 2002
Messages
43,331
I pressed F12 and used the browser's color picker, the color palette of both top/left are the same.
As I said, I could probably fix it but I should not have had to. It should have been obvious to the designer that the two menus should be in sync but apparently it was not. And none of the testers complained either or they were ignored.
Just an idea you could use for fun if you feel bored one day:
I have my own version of the navigation form. I don't need to "fix" the one that MS provides us with. I am not the one who suggested even using the navigation form.
Most apps probably won't need so many menu items that fill the entire screen in two dimensions anyway.
All it takes is for one of the major groups to have more options than will fit in the vertical constraint and that breaks the developer's design concept.
always preload the theme and color palette with VBA,
How do you do that?
 

Mike Krailo

Well-known member
Local time
Today, 11:25
Joined
Mar 28, 2020
Messages
1,044
All it takes is for one of the major groups to have more options than will fit in the vertical constraint and that breaks the developer's design concept.
In that case, you simply reduce those large amount of options onto its own form, problem solved.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:25
Joined
Feb 19, 2002
Messages
43,331
In that case, you simply reduce those large amount of options onto its own form, problem solved.
I think you missed the point. For example, if you are not using my lookup table maintenance application, you might create a dozen or more separate forms to handle lookup table maintenance. They should all be in the same top level group but if there are more than will fit in the left side list, you need to use a second tab in the horizontal group to list the remainder or create a different form within the navigation form to do the navigation for these objects because the navigation form cannot handle the case as other menuing systems can. There is always another way to "skin the cat". If you like using the navigation form, use it. I don't like it for the reasons stated so I don't use it. You can get around anything. I prefer methods I don't need to "get around".
 

Mike Krailo

Well-known member
Local time
Today, 11:25
Joined
Mar 28, 2020
Messages
1,044
I think you missed the point. For example, if you are not using my lookup table maintenance application, you might create a dozen or more separate forms to handle lookup table maintenance. They should all be in the same top level group but if there are more than will fit in the left side list, you need to use a second tab in the horizontal group to list the remainder or create a different form within the navigation form to do the navigation for these objects because the navigation form cannot handle the case as other menuing systems can. There is always another way to "skin the cat". If you like using the navigation form, use it. I don't like it for the reasons stated so I don't use it. You can get around anything. I prefer methods I don't need to "get around".
I understand the advantage of your lookup table app. Having a one stop shop to manage all of them is great.

Personally, I like the accordion web style navigation form since the menu system collapses to save space and it looks like your standard left navigation type web page. Any one of the top level buttons can be used as a regular button or serve as group identifier. It's more complicated to design, but I'm working on a way to make the maintenance of changes much easier to do and eventually package it into a class that will work on either the left, right, bottom, or top of the form. So far I like the way it has turned out, but it's going to need some more work before it's useable on any active projects. The last thing I need is a maintenance nightmare. I'm actually using your idea of the tblButtons to manage the menu and the forms to launch from the buttons.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:25
Joined
Feb 19, 2002
Messages
43,331
I threw together a quick example of a data bound version of the navigation form. It doesn't actually use buttons because I couldn't figure out how to make the button captions data bound. It also is only one level. I did add the ability to color the "buttons" for visual grouping. It's in my switchboard samples. I may add tabs across the top but unless I want to build them on the fly (which I don't), the tabs across the top need to be fixed. The next change if I get around to it will be to make the list recursive so it works the way the old Switchboard form works.

Visually, I don't think I want the list to scroll because that would require scroll bars on the subform so the list will probably always have a max item length.

The difference in concept is that the built in navigation form is created in design view and so actual objects are added at design time.
 

murphybridget

Member
Local time
Today, 23:25
Joined
Dec 5, 2023
Messages
68
I understand the advantage of your lookup table app. Having a one stop shop to manage all of them is great.

Personally, I like the accordion web style navigation form since the menu system collapses to save space and it looks like your standard left navigation type web page. Any one of the top level buttons can be used as a regular button or serve as group identifier. It's more complicated to design, but I'm working on a way to make the maintenance of changes much easier to do and eventually package it into a class that will work on either the left, right, bottom, or top of the form. So far I like the way it has turned out, but it's going to need some more work before it's useable on any active projects. The last thing I need is a maintenance nightmare. I'm actually using your idea of the tblButtons to manage the menu and the forms to launch from the buttons.
I hope your efforts in refining and packaging it into a versatile class pay off without turning into a maintenance headache.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:25
Joined
Jul 9, 2003
Messages
16,285
Hello
I would like to create a form with 3 or more sub forms
I don't want to use the control tab since it has few problems

It's not clear if you want all three forms visible at the same time on one form?

You mentioned the tab control, so my assumption is you want to switch between the three forms, like on a tab control, but without the tab control.

It's important to know how a subform comes about. It's just an ordinary form! There's nothing special about it, except that it's housed in a control called a subform/sub report control.

I like to term this control "a window" because it's like a window pane in your main form and you can look into another form through the window.

Once you have established this window on your form you can put any form you like in it with VBA!

So an alternative method would be to switch forms with VBA code with command buttons or a combo box.
 

Users who are viewing this thread

Top Bottom