How to disable "Right Click"?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alinagoo
    New Member
    • Apr 2010
    • 53

    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
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    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.

    Comment

    • munkee
      Contributor
      • Feb 2010
      • 374

      #3
      Can you not just create a MDE?

      Alternatively take a look at:

      ** Edit **
      Removed illegal link to competing forum.
      Last edited by NeoPa; Jul 22 '10, 01:21 PM. Reason: Removed illegal link to competing forum.

      Comment

      • alinagoo
        New Member
        • Apr 2010
        • 53

        #4
        Originally posted by NeoPa
        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.
        It's Bad news

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32653

          #5
          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.

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            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)>

            Comment

            • munkee
              Contributor
              • Feb 2010
              • 374

              #7
              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 =]

              Comment

              • missinglinq
                Recognized Expert Specialist
                • Nov 2006
                • 3533

                #8
                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)>

                Comment

                • CoolC401
                  New Member
                  • Jul 2010
                  • 4

                  #9
                  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.

                  Comment

                  • alinagoo
                    New Member
                    • Apr 2010
                    • 53

                    #10
                    Originally posted by CoolC401
                    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.
                    Thanks all
                    I liked to disabling Right-Click by VBA automatically not manually by manipulating menus!
                    Best Regards

                    Comment

                    • munkee
                      Contributor
                      • Feb 2010
                      • 374

                      #11
                      Code:
                      
                      Public Sub DisableMenu()
                      
                      Dim obj As AccessObject
                      Dim db As Object
                      Set db = Application.CurrentProject
                      
                      
                      For Each obj In db.AllForms
                      DoCmd.OpenForm obj.Name, acDesign
                      If Forms(obj.Name).AllowDesignChanges = True Then
                      Forms(obj.Name).ShortcutMenu = False
                      End If
                      DoCmd.Close acForm, obj.Name, acSaveYes
                      Next obj
                      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 allowsdesigncha nges to false. You could also manipulate this to just be set on form open etc to disable the right click.

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32653

                        #12
                        Originally posted by alinagoo
                        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.

                        Comment

                        Working...