Avatar of thotovec
thotovec
 asked on

VBA Enable Shortcut Menu Bar?

Hello Experts!

While testing my application, I found a number of users were inadvertently using the various command and menu bars.  To alleviate this, EE gave me a great routine I run at startup which disables all of bars -

    Dim i As Integer
    For i = 1 To CommandBars.Count
    Application.CommandBars(i).Enabled = False
    Next i

After this runs, I also have code for a custom Menu Bar I created which gives users everything they need.
    CommandBars("Custom Menu Bar").Enabled = True
    CommandBars("Custom Menu Bar").Visible = True

This works great for users - but I very much need the shortcut menu bar (right click of the mouse)!  What is this shortcut bar called and how can I add this to my VBA?
Microsoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

See this link:

http://www.jamiessoftware.tk/articles/menubars.html
       
Not sure it that article mentions it, but ... when you are in the Customize mode (dialog) ... if you hold down the Control key, you can drop and drag (ie, copy) menu items from one place to another ... handy for making a new menu that is similar another one.

mx
rockiroads

the property of the form called

"Shortcut Menu"

if that is set to No then u cannot use right click
and if set to Yes then u can

so set that property to yes then set  your menu bar in the form
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Also:

From the menu:
View>>Toolbars>Customize
On the Toolbars tab, check off 'Shortcut Menus

A menu bar will appear in the upper right ... showing all custom right click menus.

mx
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
thotovec

ASKER
Thanks for the insights - but maybe I'm not getting my point across.

Just trying to get the "right click" standard shortcut menu bar to appear -

Not a custom menu, the standard menu.

Appears in all other application, just not access.

I thought it was related to the code I typed above.

Ideas?
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
thotovec

ASKER
mx -

have you done this?

DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Not a the moment, but I have in the past.
All of my toolbars / menus are fine ... and all are customized also.

mx
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
thotovec

ASKER

The explosion on the screen is a work of art!

Now I just have to figure out which is which . . .
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

explosion ?

fireworks?

mx
jefftwilley

LOL
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

thotovec ... what happened?  menu bar R US ??
thotovec

ASKER

I tried this earlier today - which is why I asked if you've done it before.

Every menu and tool bar in Access is now open on the screen.

Its strangely appealing.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

But, you can just simply close the ones you don't want, right?


Did you get back what you needed?  Big bang for the buck, right, lol?

mx
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jefftwilley

>>Its strangely appealing. Cascade them!! ROTF!!
thotovec

ASKER
VERY big bang -

And yes - got everything back - 43 tool or command bars at last count!

So, thanks?  I guess?

Still trying to figure out which groups are the shortcut menu bar on the right mouse click!
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

"Still trying to figure out which groups are the shortcut menu bar on the right mouse click!"

This:

From the menu:
View>>Toolbars>Customize
On the Toolbars tab, check off 'Shortcut Menus

A menu bar will appear in the upper right ... showing all custom right click menus.

Every thing else are menus and toolbars ...

mx
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
jefftwilley

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
thotovec

ASKER

Well, I can definitely say I don't want to go down this path again!

The code I wrote at the beginning of the thread turns off EVERY POSSIBLE "bar" - menu bars, tool bars, custom bars, "hidden" bars, shortcut bars, you name it.

So after the reversal of the code (thanks dmx) - and the subsequent explosion of bars on my screen - I went thru and detailed which were tool bars (View -> Tool Bars -> Customize).  If you were wondering, Access has 33 tool bars - I will post the list in a second.

The ONE bar that was never visible - the ONLY ONE I was looking for - was the SHORTCUT MENUS TOOL BAR.

The only way I found to get to it back was thru Tools -> Startup and check "Allow Default Shortcut Menus".

So thanks everyone for the suggestions - and I will never touch another tool bar again.

And here's the list:

   1  Alignment and Sizing
   2  Database
   3  Diagram Design
   4  Filter/Sort
   5  Form Design
   6  Form View
   7  Formatting (Datasheet)
   8  Formatting (Form/Report)
   9  Formatting (Page)
   10  Formatting (PivotTable/PivotChart)
   11  Function Design
   12  Macro Design
   13  Menu Bar
   14  Page Design
   15  Page View
   16  PivotChart
   17  PivotTable
   18  Print Preview
   19  Query Datasheet
   20  Query Design
   21  Relationship
   22  Report Design
   23  Source Code Control
   24  Stored Procedure Design
   25  Table Datasheet
   26  Table Design
   27  Task Pane
   28  ToolBox
   29  Trigger Design
   30  Utility 1
   31  Utility 2
   32  View Design
   33  Web






DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Just Say No (picture a red line through a toolbar) :-)

Hey ... thanks for the list ... logged and noted.

mx