473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 31347
NeoPa
32,556 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
munkee
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
@NeoPa
It's Bad news
Jul 22 '10 #4
NeoPa
32,556 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
missinglinq
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
munkee
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
missinglinq
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
@CoolC401
Thanks all
I liked to disabling Right-Click by VBA automatically not manually by manipulating menus!
Best Regards
Jul 24 '10 #10
munkee
374 256MB
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. Public Sub DisableMenu()
  4.  
  5. Dim obj As AccessObject
  6. Dim db As Object
  7. Set db = Application.CurrentProject
  8.  
  9.  
  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
NeoPa
32,556 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

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

Similar topics

1
by: Bob Alston | last post by:
I am trying to highlight required data fields in a continuous form situation. Got it working for all but date fields. For date fields, I am trying setting default date to -1 (=12/29/1899) and...
5
by: Add and Paste | last post by:
Dear Access developers, I have a lot of cut and pasting to do from Excel to an Access form. But instead of just pasting, I want to "add then paste" the value. Does anybody have a way to do this?...
8
by: Ken Yu | last post by:
Hi, How can i disable "RightClick Menu" in Internet Explorer, when access the frontpage ? tks a lot ! Ken
2
by: vanvee | last post by:
Hi I have an application, that when a user double clicks a file (that the application creates), the application opens. When the user right clicks a file and selects "Open With", the program...
0
by: Jerry Boone | last post by:
I did a lot of searching and found many who said this couldn't be done. After searching I didn't "seem" to turn up anyone who provides this solution. If you posted or found something on this...
2
by: Serious_Practitioner | last post by:
Good day, and thank you in advance for any assistance. I'm having trouble with something that I'm trying for the first time. Using Access 2000 - I want to run a function either on the click of a...
7
by: the_grove_man | last post by:
How do I invoke a "Right-Click" Programmtically? John
3
by: 30knot | last post by:
is this possible in HTML? If so, what is the code? Thanks, Chris
4
by: brsawvel | last post by:
Hello, I have a form that has two subforms within it (frm1 - subfrm1, subfrm2) Does anyone know how I can create an "On Click" event for a textbox -fld1- that is within -subfrm1-...
2
by: Tom P. | last post by:
I am writting a extended ListView control and I'd like to stop the default behavior when a user right-clciks on a non-label area and then drags causing a "marching ants" selection box to appear....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.