ACC2000: Misleading Message When Form's Shortcut Menu Missing

ID: Q198966


The information in this article applies to:


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you open a form or right-click on the form to see the shortcut menu, you may receive the following message:

Microsoft Access can't find the macro '<name of shortcut menu>'


CAUSE

Either the MenuBar or the ShortcutMenu property of the form refers to a menu bar that does not exist in your database.


RESOLUTION

When you set the MenuBar or the ShortcutMenu property for a form, make sure that the property refers to a valid menu bar.


MORE INFORMATION

The error message is confusing because it refers to a macro instead of to the incorrectly set form property. In earlier versions of Microsoft Access, menus were created from special types of macros. This is the cause of the misleading error message.

While current versions of Access still support the use of macros to create menus, you should consider using CommandBars when creating custom menus. You can also convert existing macro-derived menus to command bars as follows:

  1. In the Database Window, select the menu macro that you want to convert.


  2. On the Tools menu, point to Macro, and click the command that best describes the macro you are converting:


The macro that you selected will be converted and then appear at the top of the Access window.

Steps to Reproduce Behavior

  1. Start Microsoft Access and open the sample database Northwind.mdb.


  2. In the Database window, click Forms under Objects.


  3. Create a new form not based on any table or query in Design View.


  4. Set the MenuBar property of the form to MyShortCutMenu.


  5. Open the form in Form view. Note that instead of informing you of a missing command bar, Microsoft Access displays the following message:


  6. "Microsoft Access can't find the macro 'MyShortCutMenu.'


REFERENCES

For more information about menus and shortcut menus, click Microsoft Access Help on the Help menu, type "Work with menu bars and shortcut menus" in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Additional query words:


Keywords          : kberrmsg kbdta FmsProp 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999