Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus in MDE & Right mouse button

Status
Not open for further replies.
Sep 19, 2002
34
0
0
US
OOPS Posted this in Tables etc. S/B Here.

I am trying to figure out how to allow the users to use the right mouse button to select / sort records in a form. I have created a front end - back end scenario and created a .mde file in Access 2000. During testing on my machine of course the menus work. On the user machine with only runtime installed, the right mouse button does not work. I have checked the boxes to allow full menus etc. and nothing.
Thanks for any direction to solve this.
 
Many features do not exist in the runtime of Access. If you want it to perform a specific action you can set up some VBA code for a mouse event.

-Pete
 
Thanks Pete. I can test for the mouse down event and I can read where it is on the form. It reads both left and right mouse buttons however. Do you know how to isolate just the right button.
 
Sure.
Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = acLeftButton Then
        MsgBox "You pressed the left button."
    End If
    If Button = acRightButton Then
        MsgBox "You pressed the right button."
    End If
    If Button = acMiddleButton Then
        MsgBox "You pressed the middle button."
    End If
End Sub

-Pete
 
Pete Thanks very much. That certainly does the trick. I have searched for this type of information with no success. Do you have a suggestion on where to get this info. It appears that Button is a reserved word and acLeftbutton etc are returned values?? (Y/N)
Anyway, thanks again for direction on this. I am trying to simulate the right button press to allow for a filter/ sort on the column where the mouse is depressed.

I think I can do a requery with the selection.
 
Actually Button is the variable that is passed via the function. Check the function declaration:
Private Sub Form_MouseDown([red]Button As Integer[/red], Shift As Integer, X As Single, Y As Single)

As you can see Button is an integer. That means that acLeftButton has to be an integer. acLeftButton is actually a Constant variable declared by Access when it starts. You dont have to define this because Microsoft did it for you to make it easier to understand. You could easily replace acLeftButton, acRightButton, and acMiddleButton with their cooresponding integer.
acLeftButton = 1
acRightButton = 2
acMiddleButton = 4

-Pete
 
Pete, I did some more checking (without the blinders) and sure enough, there they were. I sure appreciate to helping with this and I forgot to give you a star for the effort.
 
hi

did you find a solution to this problem?
I have the same...although sometimes on the MDE the right button filter works, sometimes doesn`t

As usual is when you need it the most that it doens't work!

your help is appreciated
 
can you post the code that you are using, maybe it will help me understand the situation more?

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top