ACC2000: Misleading Message When Form's Shortcut Menu Is Missing (198966)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q198966
Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

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. You may also receive this error message if you set the MenuBar property equal to one or more spaces.

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:
    • Create Menu from Macro
    • Create Toolbar from Macro
    • Create Shortcut Menu from Macro
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:
    "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.

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kberrmsg kbprb KB198966