ACC97: Unable to Disable Custom Menu by Using SetMenuItem ActionID: Q189902
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you run a macro that uses the SetMenuItem to disable a custom
menu option, the action fails.
To work around this behavior, you can use the SetMenuItem method from
within a Visual Basic for Application procedure, as illustrated by the
following line of code:
DoCmd.SetMenuItem 0,1,,acMenuGray
Macro Name Action
------------------------------
AddMenu
AddMenu Action Arguments
------------------------
Menu Name: Menu
Menu Macro Name: Menu
Status Bar Text:
Macro Name Action
-----------------------------
Beep Beep
Macro Name Action
----------------------------------
OpenForm
SetMenuItem
GrayMenu Action Arguments
-------------------------
Form Name: Form1
View: Form
Filter Name:
Where Condition:
Data Mode:
Window Mode: Normal
SetMenuItem Action Arguments
----------------------------
Menu Index: 0
Command Index: 0
Subcommand Index:
Flag: Gray
Command Button:
-----------------------
Name: CmdDimMenu
Caption: Gray Menu Item
OnClick: GrayMenu
For additional information about command bars, search for "CommandBars collection" using the Microsoft Access Help menu.
Additional query words: grayed unavailable dimmed greyed gray grey
Keywords : kbdta McrProb McrActn
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 26, 1999