Microsoft KB Archive/95902

{|
 * width="100%"|

PRB: Only One of Two Accelerator Keys Displayed in Custom Menu
'Article ID: Q95902

Creation Date: 01-MAR-1993

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1

SYMPTOMS

When you create a custom menu, if you define two accelerator keys in the MacroName grid, the drop-down menu will show the second one as the accelerator key, but the first key will actually run the macro action.

CAUSE

This behavior is a function of Windows. Microsoft Access does not do syntax checking on menu strings; therefore, if Windows receives a menu string with extra accelerators, the symptom will occur.

RESOLUTION

Only define one accelerator key for a menu item.

MORE INFORMATION

Steps to Reproduce Behavior

  In the sample database NWIND.MDB, create a new macro called MyMenu with the one following action: Macro Name     Action    Argument --     D&o &This       MsgBox    Message: Any text message here   Open the Orders macro, and create a new macro name called OnMenu with one action: Macro Name     Action --     OnMenu          AddMenu Add Menu Actions ---     Menu Name:   &File Menu Macro: MyMenu  Open the Orders form. Attach the macro &quot;Orders.OnMenu&quot; macro to the OnMenu property of the form. Close the Orders form, save it, and reopen it. Press ALT+F to drop the custom File menu. Note that the &quot;T&quot; in &quot;Do This&quot; is shown as the accelerator key. Press the T key. Notice that nothing happens.  Press the O key. The message box will be displayed. 
 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10

KBCategory: kbusage

KBSubcategory: McrName