Custom Menu

Posted on Saturday, September 20, 2008 - 19:22 | by admin |

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.

Custom Menu

Custom Menu

RSS feed | Trackback URI

12 Comments »

Comment by Peter
2009-01-05 02:00:01

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

Comment by Administrator
2009-01-05 14:37:19

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?

Comment by Peter
2009-01-05 16:22:43

That's right! Upon termination of the operation, the subform back to the initial state, as well as the combo.

Grateful.

Comment by Nixon
2009-05-04 13:25:40

It is possible, make this menu, but using the shortcut keys according to the previous menu.

Comment by bruno bridges
2009-10-06 12:21:58

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?

Comment by andeson
2009-10-13 19:25:53

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

Comment by Bruno
2010-07-10 19:58:42

Man Show Ball, just like an example or any tips that go with buttons instead of a combo.

hug

Comment by Bruno
2010-07-19 22:10:01

Man how to make it just that rather than their combo with buttons?

Comment by LOEMIR BIRTH
2011-01-01 19:51:28

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.

Comment by Agnaldo
2011-04-27 18:31:12

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.

Comment by Agnaldo
2011-04-27 18:43:30

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).

Comment by Claudio
2011-11-02 22:20:26

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

Name (required)
Email (required - not published)
Website
Your comment ( Decrease | Increase )
You can use <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <b> <cite> <code> <del datetime=""> <em> <i> <Q cite=""> <strike> <strong> in the comments.

Presentation

Avatar

Thank you for visiting.
Subscribe to feed not to miss any messages.

Here in blog I will provide examples of working with Microsoft Access and also ask questions to those who ask. More

Want to subscribe?

Subscribe or subscribe by email:
Enter your email:


Ads