Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727

    Disable Mouse Right Click

    I'm trying to disable the right click of the mouse in a form and its not working. I got the Key Preview property set to yes and this code in the On Key Down event:



    If Keycode = vbkeyRButton then
    Keycode = 0
    End If


    Am I missing something here?

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Can i ask as to the reason your trying to disable this ?
    Curious, and perhaps there are other ways to accomplish what your doing.

  3. #3
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Well long story short, the forms I have do not require a right click. I do already know about the full menus and default shortcut menus in Access Options. However, I have been having some issues with the right click in the ribbon area when in print preview. Right now, I have all my forms in modal format. This prevents the user from getting access to anything outside of the window, including the ribbon. On some of these forms I have a print preview button. This is where my security is weakened because when the user enters the print preview mode it opens up a new screen that is no longer in modal mode and now the user can just right click the ribbon area and select the option to customize quick access toolbar then unhide everything in the database. So I thought I'd try to disable the right click to see if that would work but something tells me it probably won't since the print preview seems to be foreign from anything that you can control in Access. I hate print preview for this but I need it because its good to see what your print out is going to look like before you confirm your print.

  4. #4
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    You can disable almost anything in access.
    Open up the options in the database and select adjust ribbon.
    There you can select what you want into the ribbon.

    In my case all users can do is undo and redo..

  5. #5
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    Examine the MouseDown Event from access VBA help. There are button events, perhaps it may help you


  6. #6
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Yes but will access ribbon adjust take care of the right click? Remember, when you right click, you get the option to customize quick access toolbar. From there users can change almost everything.

    Trevor, thanks. I'll look in to that too.

  7. #7
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Go to File -> Options -> Current Database -> (Ribbon And Toolbar Option) Uncheck Allow Default Shortcut Menus

  8. #8
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    If you can trap the mouse button event you can change the outcome...

  9. #9
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Xipooo,

    I already know about that option. That will just get rid of the right click within forms. Try testing it yourself. Right click on a tab or in the same area where the tabs are and you will see that it will give you the option to customize quick access toolbar even when Allow Default Shortcut Menus is unchecked.

  10. #10
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    Ok then, so outside the box, perhaps disable the mouse button in windows, or a 3rd party app. I'm sure that you can set both buttons to left, right or whaever. I use xmouse button control v1.5 enables control of all mouse buttons/wheels for multiple programs.

  11. #11
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    JeroenMioch,

    Its called customizing the ribbon. I am not really trying to customize it. I am trying to somehow get rid of the option to customize quick access toolbar. The way it works is if the user right clicks the home tab or anything in that area of the ribbon, the user will get a menu of options. In this menu is an option called Customize Quick Access Toolbar. If the user selects this option they will now have access to all the things that I have hidden. Try it yourself and you will see what I am talking about. This is a hole in the security system that I have created and I believe once this is solved, my database and everyone else's database will be so much better in preventing the user from screwing up the database.

    Does anyone not know how to fix this? Please give it a try with the right clicking of the ribbon area so you know what I am talking about. Right click a tab such as Home or near one of the tabs then select the Customize Quick Access Toolbar. Then go to Current Database. There you will see the user can undo everything you did.

  12. #12
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    P.S. this is the site for xmouse s/w, it's free with forums and support.
    http://www.highrez.co.uk/

  13. #13
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Hey trevor40,

    thanks but I can't use 3rd party software. This is for work and they wouldn't allow me to do that. Thanks for the suggestion though.

    I also tried messing with the On Mouse Down event but was not able to get it to disable the right click of the mouse. Here is the code I used:

    If KeyCode = vbkeyRButton Then
    KeyCode = 0
    End If

    I think even if it did work, it probably wouldn't work for what I want it to do. It would only probably work for that specific form that I apply this code to. I need it to work when all windows are closed too. I got all my forms in modal windows so it works nicely except for when I do a print preview. Then it goes outside of the modal mode and then the user can just right click the ribbon area and get access to the options to unhide everything.

    So my journey continues to find an answer. I just can't believe this seems like such an easy thing to fix when really its turning out to be a nightmare.

  14. #14
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    Are you using a customised ribbon for user interface? If not, I would suggest you to create your own ribbon so that users will not be able to customise the QAT.

  15. #15
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    The only other thing I can think of is dissable the menus, see this forum link
    https://www.accessforums.net/access/...0-a-41804.html

    It's for access 2003 so will need to be modified by you to do this with the 'ribbon' if it works for you.

    And as amrut above says, add your own menu and limit the options, but as in the post above create some way to reverse or restore the menus via password, or a restore menus db.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Mouse Over/Hover Over
    By nndatabase in forum Forms
    Replies: 3
    Last Post: 06-07-2013, 04:45 PM
  2. Mouse pointer (=
    By denggoy in forum Access
    Replies: 3
    Last Post: 11-15-2011, 05:30 PM
  3. Replies: 0
    Last Post: 09-27-2011, 04:27 AM
  4. Replies: 1
    Last Post: 06-02-2009, 04:44 PM
  5. Mouse click to open form
    By darryl.charles in forum Programming
    Replies: 0
    Last Post: 09-05-2008, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums