|
|
|
| Подскажите пожалуйста как обратиться к вложенному пунку меню в Access?
Меню 1 --
--
--Меню 2
Нужно обратиться к меню 2 | |
|
| |
|
|
|
| SetMenuItem
Из хэлпа
The SetMenuItem method carries out the SetMenuItem action in Visual Basic.
expression.SetMenuItem(MenuIndex, CommandIndex, SubcommandIndex, Flag)
expression Required. An expression that returns one of the objects in the Applies To list.
MenuIndex Required Variant. An integer, counting from 0, that's the valid index of a menu on the custom menu bar or global menu bar for the active window, as defined in the menu bar macro for the custom menu bar or global menu bar. If you select a menu with this argument and leave the commandindex and subcommandindex arguments blank (or set them to –1), you can enable or disable the menu name itself. You can't, however, check or uncheck a menu name (Microsoft Access ignores the acMenuCheck and acMenuUncheck settings for the flag argument for menu names).
CommandIndex Optional Variant. An integer, counting from 0, that's the valid index of a command on the menu selected by the menuindex argument, as defined in the macro group that defines the selected menu for the custom menu bar or global menu bar for the active window.
SubcommandIndex Optional Variant. An integer, counting from 0, that's the valid index of a subcommand in the submenu selected by the commandindex argument, as defined in the macro group that defines the selected submenu for the custom menu bar or global menu bar for the active window.
Flag Optional AcMenuType | |
|
| |
|
|
|
| Не знаю насколько это правильно, но работает:
CommandBars("Test").Controls("MyMenu1").Controls("MyCbBtn")' например .Execute
|
| |
|
| |
|
|
|
| А еще можно через FindControl Method. | |
|
| |