Disabling Shortcut menu Item

G

Guest

Hello,

I have customized my own ShortcutMenu in which it has Macros as the Items.
All is working ok.

What I would lke to know is that somtimes I would like certain Items of this
Shortcut Menu to be disabled & other items to have them all enabled.

Can this be done with VBA code to control this ? If so how ?

I saw from the Help menu
DoCmd.SetMenuItem 0, 1, , acMenuGray
which is what I would like to do but it says:
"Note The SetMenuItem method works only with custom menu bars and global
menu bars created by using menu bar macros. "

Can this be used for Shortcut Menus & how ? or other code like this for
Shortcut menus ?

Any help would be greatly appreciated.

Thank you,
Jeff
 
A

Albert D. Kallal

if IsInGroup(CurrentUser,"SuperUser" then

CommandBars("menu bar").Controls("records").
Controls("refresh").Visible = True

end if

if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then

CommandBars("myCustomBar").Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True

end if

Note that short cut menus are their own name also:

commandbars("your shortcut name").
Contorls("contorlName").Visible = false

or


commandbars("your shortcut name").
Contorls("contorlName").Enabled = false

additional notes:
You can use "enabled" in place of visible.
The above examples should be on one line...but I wrapped them into two
lines for ease of reading....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top