Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Create Menus with Macros


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 OpenReport 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 Form in the View property.
  14. Type a dash (-) character in the next row under Macro Name column.
  15. Type &GotoNext in the fifth row under 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 running Programs etc. 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 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 set of actions.  In this case this Macro will have more than one AddMenu Action lines with 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 normal view.
  11. Right-Click on the Form to display the Shortcut Menu.  See the sample image given below:

Try out 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 are subject to moderation before publishing.


Subscribe in a reader
Your email address:

Delivered by FeedBurner

Blog Directory Visit blogadda.com to discover Indian blogs


Popular Posts

Search This Blog

Blog Archive

Powered by Blogger.

Follow by Email


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

Featured Post

ROUNDDOWN Function of Excel

We have introduced ROUNDUP() Function of Excel in Microsoft Access earlier.  It works like ROUND() Function except that the number is alway...


Blog Archive

Recent Posts