Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mouse Right Click (A2k)

    Is it possible to program the Right Click of a mouse to, lets say open a form ?
    Is there a VBA command ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Mouse Right Click (A2k)

    The usual action for the right mouse button is to pop up a context menu. There are several context menus in Access; they are all customizable just like toolbars.

    In a form, you can trap the Mouse Down and Mouse Up events; one of the arguments passed in the event procedure is Button, which can be acLeftButton, acMiddleButton and acRightButton.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mouse Right Click (A2k)

    Hans
    Just had a little play with this using the Mouse Down ( If acLeftButton = True Then ) and also in the KeyDown property.

    No go, I still get the context menu's.

    I would like to open a form with certain criteria to follow.
    The criteria isn't important at this point but a help with the syntax would be nice.
    I'm not sure if using this approach is advisable, but I'd like to investigate it though.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Mouse Right Click (A2k)

    It violates the standard right-click behavior, Dave. Right clicks in Windows apps bring up context menus. Making them do something else can get confusing for users. However, there's nothing wrong with creating a custom context menu that allows the user to open a form, and that would be consistent with standard Windows interface design and should give you what you want.
    Charlotte

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Mouse Right Click (A2k)

    Dave,

    If acLeftButton = True Then doesn't make sense. But as I tried to indicate, and Charlotte has stated more forcefully, you are trying to go against standard Windows interface design. You can design your own context menu and assign it to a form by setting the ShortcutMenuBar property of the form to the name of the context menu.

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mouse Right Click (A2k)

    Hans, Charlotte

    Ok, Two against one's not a fair fight. I'll surrender gracefully and forget the Right Click. <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    Thanks for the sound advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •