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

  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.

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 « [...]



Subscribe in a reader
Your email address:

Delivered by FeedBurner


Popular Posts

Search This Blog

Blog Archive

Powered by Blogger.


Forms How Tos Functions MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Queries External Links msaccess reports msaccess tips Accesstips Array Menus and Toolbars MsaccessLinks Process Controls Art Work Class Module Downloads msaccess How Tos Graph Charts Objects msaccessQuery Combo Boxes List Boxes Property VBA Collection Object Command Buttons Data Emails and Alerts Query Calculation Custom Wizards DOS Commands Data Type Dictionary Object ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Object Reference msaccessprocess security advanced Access Security Add Controls Custom Functions Field Type Form Form Instances Item Key Macros Menus Report Top Values Variables msaccess email msaccess menus progressmeter Access2007 Auto-Number Copy Event Expression Fields Join Methods Microsoft Numbering System Records Recordset Security Split SubForm Table Time Difference Utility WithEvents Workgroup Wrapper Classes database msaccess wizards tutorial 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 Excel 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 RaiseEvent Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Tables Union Query User Users Water-Mark Word automatically commands function hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code

Featured Post

WithEvents and Defining your own Events

Hope that you have gone through last week’s WithEvents, Event, RaiseEvent introduction, tried out the sample Forms and understood as how bo...


Blog Archive

Recent Posts