Open form using right mouse button

Brian Martin

Registered User.
Local time
Today, 13:21
Joined
Jul 24, 2002
Messages
68
I am trying to open formB from form A by using formA's key press event. I want to do it using the right mouse button. I typed in the constant for this vbKeyRButton but it didn't work. However when I used vbKeyBack it worked. Why isn't it working for vbKeyRButton?
 
Interesting, because a form's Keypress event should not run with mouse actions ... This might be what you are looking for ...

Code:
Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = vbKeyRButton Then
        MsgBox "It's the Right"
    ElseIf Button = vbKeyLButton Then MsgBox "It's the Left"
    End If
    DoCmd.CancelEvent

End Sub

What is your code?
 

Users who are viewing this thread

Back
Top Bottom