Insert 2 navigation control on top at same form (1 Viewer)

zezo2021

Member
Local time
Today, 15:47
Joined
Mar 25, 2021
Messages
381
Screenshot_2.png


Hello friends

How can I create 2 line navigation control

or 2 navigation control on top
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:47
Joined
Feb 19, 2013
Messages
16,607
use buttons or labels laid out as you require?
 

zezo2021

Member
Local time
Today, 15:47
Joined
Mar 25, 2021
Messages
381
require using mouse to navigate to last button on navigation
not nice

If I have 2 navigation at top is better
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:47
Joined
Feb 19, 2002
Messages
43,223
You have much better control if you build your own navigation form rather than using the specific Access Navigation form.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:47
Joined
Feb 19, 2013
Messages
16,607
don't believe you can, use buttons or labels as suggested.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:47
Joined
May 7, 2009
Messages
19,233
there is already a menu on Ribbon.
Create->Navigation->Horizontal Tabs, 2 Level
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:47
Joined
Feb 19, 2002
Messages
43,223
The code behind each button click even on a form you build yourself sets the ControlSource of the Subform Control if you want to have the form work like the Access one. Otherwise, you can use a tab control and on each tab, put a subform control. In that version, you don't need code at all. Be careful using the tab control version because loading a form with dozen of subforms can be time consuming. That is why the Access version uses only a single subform control and loads the desired subform when you click a button. This makes the form less resource intensive but also less flexible since no subform can refer to any other subform since only one subform is ever loaded at one time.

I don't have a sample since personally, I use a Switchboard/Menu form that is controlled by a table. That way i don't have to modify a navigation form every time I want to add a new object. I just add it to the table and the option shows up in the list.

It is a matter of preference for how you want your interface to work and how much maintenance you are willing to do going forward. Using hardcoded buttons makes it more difficult to add new options because usually you don't want to just add the new option to the end of the row of existing buttons. Once you want to put the new option in some logical order, you have to rearrange all the buttons. With a Switchboard type menu, Items are numbered so you can just change their sequence by changing their number and you can also have a hierarchical menu so clicking on an option might open a form or might drill down to a more detailed list of options.

I attached a db with just the Switchboard form and Switchboard Items table. This is a modified version of the old Access Switchboard so it allows 12 items rather than 8 but that means that you can't use the wizard to update the Switchboard Items table for any item higher than the number 8. None of the form's buttons will work because none of the items they reference are included. To make this work for you, you would need to replace the items (except for the exit) in the table to reference your own forms and reports.

By examining the code, in the HandleButtonClick procedure, you can identify the values used in the Command field which specify what the button is supposed to do, i.e. open a form, run a macro, open a different switchboard, etc. The Argument field is the name of the object you want to "open" or execute.

The constant named conNumButtons is defined in the FillOptions sub. It is set as 12. The original version was 8. You can increase the number to whatever you want but you will need to modify the form to add additional controls. So, if you want the menu to show 16 items, change the constant to 16 and add four more buttons/captions with the appropriate values.
 

Attachments

  • SwitchboardONLY.zip
    49.3 KB · Views: 204
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:47
Joined
Feb 28, 2001
Messages
27,142
Seems like the best bet for that mixed bag of options is to build a bunch of command buttons and perhaps use the button wizards to achieve some of those desired effects. Given that you didn't provide more details about your intent, it would be hard to give you specific advice, precisely because you appear to have a mixed bag of goals there. It is surely possible to do what you want, though.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:47
Joined
May 7, 2009
Messages
19,233
see this demo
 

Attachments

  • 2navigation.accdb
    520 KB · Views: 224

zezo2021

Member
Local time
Today, 15:47
Joined
Mar 25, 2021
Messages
381
The code behind each button click even on a form you build yourself sets the ControlSource of the Subform Control if you want to have the form work like the Access one. Otherwise, you can use a tab control and on each tab, put a subform control. In that version, you don't need code at all. Be careful using the tab control version because loading a form with dozen of subforms can be time consuming. That is why the Access version uses only a single subform control and loads the desired subform when you click a button. This makes the form less resource intensive but also less flexible since no subform can refer to any other subform since only one subform is ever loaded at one time.

I don't have a sample since personally, I use a Switchboard/Menu form that is controlled by a table. That way i don't have to modify a navigation form every time I want to add a new object. I just add it to the table and the option shows up in the list.

It is a matter of preference for how you want your interface to work and how much maintenance you are willing to do going forward. Using hardcoded buttons makes it more difficult to add new options because usually you don't want to just add the new option to the end of the row of existing buttons. Once you want to put the new option in some logical order, you have to rearrange all the buttons. With a Switchboard type menu, Items are numbered so you can just change their sequence by changing their number and you can also have a hierarchical menu so clicking on an option might open a form or might drill down to a more detailed list of options.

I attached a db with just the Switchboard form and Switchboard Items table. This is a modified version of the old Access Switchboard so it allows 12 items rather than 8 but that means that you can't use the wizard to update the Switchboard Items table for any item higher than the number 8. None of the form's buttons will work because none of the items they reference are included. To make this work for you, you would need to replace the items (except for the exit) in the table to reference your own forms and reports.

By examining the code, in the HandleButtonClick procedure, you can identify the values used in the Command field which specify what the button is supposed to do, i.e. open a form, run a macro, open a different switchboard, etc. The Argument field is the name of the object you want to "open" or execute.

The constant named conNumButtons is defined in the FillOptions sub. It is set as 12. The original version was 8. You can increase the number to whatever you want but you will need to modify the form to add additional controls. So, if you want the menu to show 16 items, change the constant to 16 and add four more buttons/captions with the appropriate values.
Thank you for your effort I learn a lot from this post
(y) (y) (y) 👆 👆 👆
 

vhung

Member
Local time
Today, 06:47
Joined
Jul 8, 2020
Messages
235
Good day...

There are several design for navigation form, and each choice would matter.

See attached picz...
favorites navForm.png

This is cute and simple design in which you could add your favorite forms.
On select, it would open a form and on click, "Close" button exit an open form.
 
Last edited:

Users who are viewing this thread

Top Bottom