Custom Menu
This is a kind of menu that allows us to save time, lines of code and a better arrangement in terms of open forms, since with this menu just need an open form. In addition to reducing the number of open forms also decreases the number of buttons in a menu to open each form.
This type of menu, certainly that has existed for some time and is already used by many users of Access.
So where is this menu?
Let's create the menu using a combo box that contains all the forms that we plan to open through it. When you select an option from the combo box the application form is displayed within the subform. Then we begin to make the menu step by step.
1 - Let's create a table where we will store the name you want to give each form and name of the form that will open. In the example I created the table 'tblmenu' with the following fields:
Field Type
Nomedomenu text -> Name that will be seen in the menu (combo box)
form text -> Name of the form that will open
After the data introduced in the example are:
NomedoMenu Form
Accounts Form1
Deposits Form2
Movements formulario3
Account-Box formulario4
Account-Account formulario5
Extract formulario6
2 - Then we create a query from the previous table:
Tblmenu chose the table and then choose the two fields in which we chose for ascending sort nomedomenu to be easier to find the menu quite a few times when we want to open forms. To this query I called 'CsMenu'.
3 - Let's create the form 'Menu', ie choose new form in Design view. Then we create a combo box and change the following properties:
- Number of columns: 2
- Column Widths: 1cm, 0cm;
- Origin of the line: csmenu (which is the name of the query created in the previous paragraph)
4 - In the same form we will create an unbound main form's subform (In the example I called menuquadro). It is this form that will be open each of the forms to choose from the menu (combo box).
5 - Now create a module that will allow us to open the menu that is selected in the combo box in the subform.
We created a module (which I called 'abrirmenu') and pasted the following code:
Public Function AtivarMenu (Combmenu The ComboBox, subabrir The Subform)
Abrirform As String Dim
= abrirform Combmenu.Column (1)
subabrir.SourceObject = abrirform
subabrir.LinkChildFields = ""
subabrir.LinkMasterFields = ""
End Function
After going to the properties of the combo box on the form menu and the After Update event put the created function: ativarmenu = ([Menu], [menuquadro]) that 'Menu' is the name of the combo box and 'menuquadro' the name of the subform.
And finally the menu is ready for use. Just try and use. I hope you enjoyed this tip.
Download: Menu
Below a picture of the menu.































I put a CANCEL button on Form2 and would like by clicking the subform back to original position, ie, stay blank and empty as well with the combo. How to build this Function?
Thank you,
Peter
Hello Peter,
Do not quite understand what to do. From what I understand either by a button on the subform that causes the menu to return to the initial state, is it?
That's right! Upon termination of the operation, the subform back to the initial state, as well as the combo.
Grateful.
It is possible, make this menu, but using the shortcut keys according to the previous menu.
managed to make good the menu following the steps described here, but my forms have combo boxes in the forms and inter-related work but when step for formulariomenu stop operating. What can I do?
I do not know how to ask more I wanted to know how to do
faser to an executable in PROAMA poelomenos trabale with access to hours and price
Man Show Ball, just like an example or any tips that go with buttons instead of a combo.
hug
Man how to make it just that rather than their combo with buttons?
I NEED A HELP: DID A SYSTEM OF DATABASE ACCESS IN AND WHEN NEEDED FOR A PARTICULAR PERSON IN selects CHECKBOX FORM NO, PHOTO CORRESPONDENT open.
The buddy liked more of this tip, but I did not get success ... could send me step by step? I do not know much about access but I have willpower if you can help me with this i would be grateful.
My doubt here is, how can I save a form with two different names?
3 - Let's create the form 'Menu', ie choose new form in Design view. Then we create a combo box and change the following properties:
- Number of columns: 2
- Column Widths: 1cm, 0cm;
- Origin of the line: csmenu (which is the name of the query created in the previous paragraph)
4 - In the same form we will create an unbound main form's subform (In the example I called menuquadro). It is this form that will be open each
forms to choose from the menu (combo box).
Hello,
I found your fantastic menu, just wanted to open reports as well and when I put the name in my report did not work, could give a hint?
abs,
Claudio