Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Create Menus with Macros

Introduction - MS-Access 2003.

We have learned how to create Menus and Toolbars through Toolbars - ->Customize options, in earlier Posts.  If you would like to have a second look at them, then the links are given below:

There are other methods to create simple custom menus for Forms/Reports and use them with your Applications.  We are going to learn how to create a Shortcut Menu with Macros and attach it to a Form.

Sample Demo Run.

  1. Select the Macro Tab on the Objects pane.

  2. Click New to open a new Macro in Design View.

  3. If the Macro Name Column is not visible, then click on the Macro-Name Toolbar Button (with xyz label) to display the Macro Name Column.

  4. Type Clo&se under the Macro Name column in the first row.

  5. Select Close from the drop-down list of Action.

  6. Type &Preview in the second row under Macro Name.

  7. Under Action select the OpenReport option from the drop-down list.

  8. In the Property Sheet under Action Arguments select a Report from your list of Reports (I have selected Employees in the sample image given above) in the Report Name Property.

  9. Select Print Preview in the View Property.

  10. Type &Form in the third row under the Macro Name column.

  11. Select  Open Form in the Action Column.

  12. Select an existing Form's name from the Form Name Property drop-down list.

  13. Select the Form in the View property.

  14. Type a dash (-) character in the next row under the Macro Name column.

  15. Type &GotoNext in the fifth row under the Macro Name column.

  16. Select GotoRecord in the Action Column.

  17. Type &Minimize in the sixth row under Macro Name.

  18. Select Minimize from the drop-down list in Action Column.

  19. Save the Macro with the name mcrShortCut and close it.

You can add as many commands or actions like opening Queries or for running Programs can be added to your menu for the convenience of your Application Users.

Defining Macro as Menu.

Our work on the Macro Menu is complete, but a little more work is left to define the Macro as a Menu. 

  1. Open a new macro in the design view.

  2. Select AddMenu from the drop-down list in Action Column.

  3. Leave the Menu Name Property Blank. This is used for Group Menu Names when you have group Menus with different sets of actions.  In this case, this Macro will have more than one AddMenu Action line with a different set of Menu Macros.

  4. Select mcrShortCut in the Menu Macro Name Property.

  5. Save the macro with the name mcrShortCutMenu.

  6. Open one of your Forms in Design View (don't open the form that you have used in the OpenForm action in the first macro).

  7. Display the Form's Property Sheet (View - ->Properties).

  8. Set the following Property Values of the Form as given below:

    • Shortcut Menu = Yes
    • Shortcut Menu Bar = mcrShortCutMenu
  9. Save the Form.

  10. Open the Form in a normal view.

  11. Right-Click on the Form to display the Shortcut Menu.  See the sample image given below:

Try out the options displayed in the Shortcut Menu.

We can not only create Shortcut Menus but also Toolbars and Menu Bars too.  This we will learn Next.


1 comment:

  1. [...] plant species in the same area and make many vegetables and fruit grown together | Fresh News LEARN MS-ACCESS TIPS AND TRICKS - Create Menus with Macros Graphic Design Projects – 890th Edition « Freelance Graphic Design Projects « [...]


Comments subject to moderation before publishing.




Post Feed


Popular Posts

Blog Archive

Powered by Blogger.


Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Objects Menus and Toolbars Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Combo Boxes Dictionary Object ListView Control Query VBA msaccessQuery Calculation Event Graph Charts ImageList Control List Boxes TreeView Control Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Key Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances ImageList Item Macros Menus Nodes RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference Utility WScript Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Desktop Shortcuts Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Message Box Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code