commandbar submenu VBA syntax

  • Thread starter Thread starter Toxalot
  • Start date Start date
T

Toxalot

I can use the following to get to the top item in a commandbar, but
how do I get to a submenu item?

Application.CommandBars("mbMainCC").Controls("Print").Enabled = True

Jennifer
 
Toxalot said:
I can use the following to get to the top item in a commandbar, but
how do I get to a submenu item?

Application.CommandBars("mbMainCC").Controls("Print").Enabled = True

Jennifer

here is some sample of "walking" down to sub menus...

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 I broke up the above into multiple lines for ease of read...

The code will actually looks like:

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

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

Similar Threads

Nested Sub Menus 3
Disabling a menu item 5
Menu Ideas in Access 2010 0
top menu issues 1
Sub menu 3
How to run sub menu items from VBA 7
commandbar question 3
Excel 2013 menubar incompatibility? 1

Back
Top