My Client uses the right click option on all his forms (about 14) to bring up the popup that allows him to select a specific record.Popup.docx See attached copy of popup.docx. This popup appears if the user right clicks in a specific field.
The right click also allows the user to go into the forms design view which is a security risk. (If the right click is not on a specific field)
I have deactivated the right click option in the MS Access Option option when the 'File' option is selected and then "Current Database" and then un-click the "Allow Default Shortcut Menus". This however deactivates the popup to do the filter bit.
Is there anyway that I can deactivate the right click mouse button, but allow the popup to do the filter bit.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Let me suggest you get Dale'sAccess Shortcut Tool, which is something I use weekly and without which, well ... it would be painful at best to continue to develop Custom right click shortcut menus ... since the original Customize tool was removed in A2007. I helped Dale beta test this tool for almost a year, wherein many cool features were added that were not present in the original Microsoft Customize tool. No need to mess with code when this super cool and extremely useful tool exists!
Highly Recommended ....
Anton Greffrath
ASKER
Comment for Dale Fye:
Thanks for the information in the articles you recommended. My requirement is to turn off some of the 'Right Click'/Shortcut/CommandBars' that exist on the Form object in MS Access 2013/2016 and I am sure that your recommended article (CommandBars (Part III) - Using Built-in Shortcut Menus) will do the trick
I did include the suggested code to assist in identifying the names of the PopUp menus in my Application but when I run it (F8) i get the error 'User Defined type not defined'. This is for the command: 'Dim cbr as CommandBar' I presume the same will happen with the command: Dim btncbr as CommandBarButton
Am I overlooking something?
Dale Fye
Check to make sure you have the Microsoft Office #.0 Object Library (where # represents the current version of Office you are using) listed as a reference in your application.
After you have the code working, you can change your declarations to:
dim cbr as Object
dim btn as Object
and remove the reference, but for your initial work, you need that library referenced. Plus this will give you intellisense.
I got the code to execute successfully, but when I click on the 'What's This' option on the popup I get a Run time error 424, Object require in the code line marked with an X
Public Sub WhatsThis()
Dim cbr As Object
Dim btn As Object
I obtained most of the info I require from your documentation, however there is one specific bit of info that I cannot find. My objective is to 'disable'/'hide' one specific option on a specific popup on a form. The popup name is "Form View Popup" and it appears when you click anywhere on (any) form. outside any control. See Attached Form-View-Popup.docx
On this Popup I want disable the option "Design View". My question is: How do I get access to the controls at this level. i.e. "Form View", "Layout View" "Design View" etc.
Your document "CommandBars (Part iii) Section C (A third Method to hide controls. . . .) describes how to hide/reveal all the built-in controls in a shortcut menu in one step but not how to hide/reveal only one of these built in controls.
Highly Recommended ....