I hope someone comments on this article to tell me that there is a better solution. I was unable to find it. The application requirements were:
- Hide the right-click menus on the form and report title bars (shown below) to prevent users from entering “Design View”

- Keep the right-click menus with textbox controls (shown below) to allow users to use it for Copy and Paste.

Microsoft Access has an option in the Current Database tab of Options to disable all the right-click menus and that option is called “Allow Default Shortcut Menus”. However, when I unchecked that, I could not figure out a way to enable the right-click menus solely within textbox controls to allow Copy and Paste.
My solution is to keep this option (“Allow Default Shortcut Menus”) set to checked (true), then run some code as the users open the application in AutoExec to disable the right-click on the form and report headers. I found no documentation that clearly described how to disable the right-click on the form headers, but with much trial and error I found that if I disabled all CommandBars that did not have a name, I got the result I was looking for.
Private Sub DisableCommandMenus()
For Each Item In CommandBars
If Item.Enabled = True Then
'The menus we want to disable are those that don't have names
If Trim(Item.Name) = "" Then
Item.Enabled = False
End If
End If
Next
End Sub
The code above disables menus that don’t have names. It is possible that I will need to disable more of the CommandBars, but at the moment my solution appears to be complete.
Do you know of a better solution to this?