Disable custom menu item

M

Mike Robinson

How do you disable a custom menu item with VBA? I have several menu items
(pull down type) like File, Edit, and Help etc… I need to disable some of the
items under these menus based upon security level.

Thanks
Mike Robinson
 
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").visiable = false

Note that the first two examples show how to traverse to a sub-menu. And,
you can change visiable to "enabled" if you want to just gray out the menu
item.

Also, I have wrapped the above examples for ease of read, but they go on one
line....
 

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