Avatar of Clive Beaton
Clive Beaton
Flag for Australia asked on

How can I prevent shortcut menus

I get standard menus on fields where I don't have my own shortcut menu.  How can I prevent the standard shortcut menus?

Thanks in advance

CRB
Microsoft Access

Avatar of undefined
Last Comment
Dale Fye

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Anders Ebro (Microsoft 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.
Clive Beaton

ASKER
Thank you very much, Anders,

Clive
Dale Fye

Unfortunately, the technique described by Anders turns off all the built-in menus.

Each form also has a method that allows you to block shortcut menus, you can set "Shortcut Menu" = No, but again that blocks all shortcut menus on a form.  To overcome this, you can use the MouseUp event, check for the right click, and then use the commandbars ShowPopup method to display your menu.

Another alternative would be to use the Form Open and Form Close event to disable/enable specific commandbars:

CommandBars("form datasheet row").Enabled = False

but you will need to know the name of the commandbars you want to disable, and need to make sure you enable them again on form close or they will not show up on other forms either.  To do this, you will need to know the name or index of the commandbar, if you download the Access Shortcut Tool, it will provide that information.
Clive Beaton

ASKER
Thanks Dale.  Very much appreciated.

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

hope it helps