Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    19

    Question Unanswered: Double Click event not calling.

    I have a ms access form with a image frame control on it, on single click of the image frame it opens up a form with the image full screen and when double click it opens up a form to change the image only the double click event is not calling, when double clicking on the image frame, the single event is calling instead of double click event, does this mean you cant have a double click event if you have a single click event?

    i cant understand why the double click event is not calling, do i need code in the single click event procedure to account for the possibility of a second click, this problem has defeated me

    any help will be gratefully appreciated.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    That's right, you cannot handle both Single Click and Double Click event for the same control. What you can do is to use the MouseUp event and use the combination of a click plus a key (Control, Shift or Alt) to distinguish between two actions. Ex. Click alone = open a form with the image full screen, while Click + Shift key = open a form to change the image:
    Code:
    Private Sub Image0_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
        If Button = acLeftButton Then       ' Left mouse button.
            If Shift = 0 Then               ' No key pressed.
                DoCmd.OpenForm "Frm_FullImageView"
            ElseIf Shift = acShiftMask Then ' Shift key pressed (could be acCtrlMask  or acAltMask).
                DoCmd.OpenForm "Frm_ChangeImage"
            End If
        End If
        
    End Sub
    Have a nice day!

  3. #3
    Join Date
    Jul 2011
    Posts
    19

    Thumbs up

    Thanks Sinndho, that backsup what i quessed and thanks for the alternative suggestion, sounds like the best solution.

    Very helpful as always

    Thanks

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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