Cancel event isn't canceling (1 Viewer)

kirkm

Registered User.
Local time
Today, 21:37
Joined
Oct 30, 2008
Messages
1,257
I'm using https://www.devhut.net/vba-wia-rotate-an-image/ to rotate a Pictures on my Form with this code
Code:
Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Dim tempPic As String
    Dim DegreeShift As Long
    
    DoCmd.CancelEvent
    DegreeShift = IIf(Button = LEFT_BUTTON, 270, 90)
    
    tempPic = CurrentProject.Path & "\tp\"
    If FolderExists(tempPic) = False Then
    'make a temp folder which is deleted in the Form close event
        MkDir (tempPic)
    End If
    'Build temporary filename
    tempPic = tempPic & CLng(Now) & NumbersOnly(Format(Now, "hh:mm:ss")) & GetExt(Me.Picture)
    
    DegreeShift = IIf(Button = LEFT_BUTTON, 270, 90)
    Call WIA_RotateImage(Me.Picture, tempPic, DegreeShift)
    Me.Picture = tempPic
End Sub
The problem is DoCmd.CancelEvent Should this prevent the right click menu appearing, as it isn't ?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:37
Joined
Feb 19, 2002
Messages
43,257
The event doesn't have a Cancel argument so if you don't want to continue, use Exit Sub instead.
 

kirkm

Registered User.
Local time
Today, 21:37
Joined
Oct 30, 2008
Messages
1,257
and if I do want to continue without showing the menu, is this possible ?
 

kirkm

Registered User.
Local time
Today, 21:37
Joined
Oct 30, 2008
Messages
1,257
Got it. Shortcut menu = False.
 

Users who are viewing this thread

Top Bottom