469,268 Members | 920 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

How to disable "Right Click"?

Hello all
I have a new problem with my application.
I want users of my application be disable to entering in design view of a Form by right clicking on the forms and selecting Design View.
If there is any way to disabling Mouse right click at Run time with VBA please aware me.
Thanks in advanced
Jul 22 '10 #1
11 27991
32,171 Expert Mod 16PB
I know of no way to intercept or disable right-clicks per se, but a database password would ensure it wouldn't open without the password.
Jul 22 '10 #2
374 256MB
Can you not just create a MDE?

Alternatively take a look at:

** Edit **
Removed illegal link to competing forum.
Jul 22 '10 #3
It's Bad news
Jul 22 '10 #4
32,171 Expert Mod 16PB
It's not all bad. Consider Munkee's suggestion of an MDE for distribution (or ACCDE I believe for Access 2007 and beyond). I would expect this to be perfect for you.
Jul 22 '10 #5
3,532 Expert 2GB
I believe you can customize the Short Cut Menu to remove the Design View option. In Form Design View invoke Access Help and enter the phrase "shortcut menu" then select "Customize a shortcut menu" and follow the Yellow Brick Road!

Linq ;0)>
Jul 22 '10 #6
374 256MB
Sorry about the link NeoPa.

There are plenty of options still for you alinagoo. If you choose to move to mde (prior to 2007 as NeoPa pointed out). The mde would stop accidental design changes and as long as you also keep a backup version of the original MDB file you can make any future changes in that file and then just recreate a new mde for distribution.

You could also take a look at creating your own user login system the basic idea would invovle a user logging in, their permissions stored within a table. Upon every Form_Open event you would check their permission, if they do not have the rights to view then you can just do a cancel = true and display some message. This route can also allow you to manage views so allowing certain users only read access, others add/edit etc. In both cases you can also turn shortcut menu = off which would get rid of the menu right click I believe.

Edit: Seems missingling suggested the short cut menu whilst I was typing up this post =]
Jul 22 '10 #7
3,532 Expert 2GB
And last, but not least, you could always use the SMMM (Sister Mary Margaret Method) that involves the application of a heavy steel-edged ruler to the hand of anyone monkeying with your form design! If you're not familiar with this method, any associate who attended Catholic schools will be able to explain it to you!

The truth is that you're obviously talking about a multi-user database here, which means that the app should be split in a front end/back end configuration, with the forms residing in the front end, a copy of which should be on each user's hard drive. If they do go in and monkey with the design, it will only be effecting their copy of the form, and sooner or later they'll probably scrootch the pooch and require help, and you'll know that they diddled with it when they shouldn't have!

This problem was brought up in a class I helped give a while back and it was suggested to the small company owner who raised the question that he simply tell his employees that modifying a database without authorization was tantamount to destroying company property and anyone caught doing so would be immediately terminated. He followed this advice and reported 6 weeks later, on the last day of class, that the problem had been totally resolved!

Linq ;0)>
Jul 22 '10 #8
I publish our monthly MIS database to users on a bi-weekly basis. I keep a master copy as a backup, so I am not concerned of users messing up the database.

In Access 2007 (or most of previous Access), you can disable right-click by going to design mode of the form and under "Other" tab, change the "Shortcut Menu" to No. The problem may arise if users need to sort data using the right-click button. The other potential problem is Access 2007 always have the ribbons enabled. The old method of creating your own menu no longer exists. And ribbons by default have the "Design" button enabled.
Jul 22 '10 #9
Thanks all
I liked to disabling Right-Click by VBA automatically not manually by manipulating menus!
Best Regards
Jul 24 '10 #10
374 256MB
Expand|Select|Wrap|Line Numbers
  3. Public Sub DisableMenu()
  5. Dim obj As AccessObject
  6. Dim db As Object
  7. Set db = Application.CurrentProject
  10. For Each obj In db.AllForms
  11. DoCmd.OpenForm obj.Name, acDesign
  12. If Forms(obj.Name).AllowDesignChanges = True Then
  13. Forms(obj.Name).ShortcutMenu = False
  14. End If
  15. DoCmd.Close acForm, obj.Name, acSaveYes
  16. Next obj
  17. End Sub
If the sheer number of times to keep setting the shortcut menu off is becoming the hassle then you can always just loop through each form disabling it.

Give this a go, place it in a module and run from there. Any sheets you do not wish to disable change the forms allowsdesignchanges to false. You could also manipulate this to just be set on form open etc to disable the right click.
Jul 24 '10 #11
32,171 Expert Mod 16PB
alinagoo: I liked to disabling Right-Click by VBA automatically not manually by manipulating menus!
Have you tried Linq's suggestion from post #6? Surely that effects the whole database, and you need only do it once.
Jul 24 '10 #12

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jerry Boone | last post: by
2 posts views Thread by Serious_Practitioner | last post: by
7 posts views Thread by the_grove_man | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.