TimerInterval & events (any pointers)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • panteraboy
    New Member
    • Apr 2008
    • 48

    TimerInterval & events (any pointers)

    Hey there again byters .My previous post was called click & hold(need info). I thought i had solved the problem but after testing i realise that its no doing what its supposed to. i wished to open a form after holding down the mouse on an image for 3 seconds. But the code just waits 3seconds to go to the form after clicking. if the user doent hold down the mouse for 3 seconds i dont want the form to open. Any suggestions gurus

    [CODE=vb]
    Private Sub Form_Timer()
    DoCmd.OpenForm ("pcspecs2")
    Me.TimerInterva l = 0

    End Sub
    Private Sub Image30_MouseDo wn(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.TimerInterva l = 3000
    End Sub[/CODE]
    I tried using this code too but to know avail
    [CODE=vb]Private Sub Form_Timer()

    If (Me.TimerInterv al <= 3000) Then
    DoCmd.OpenForm ("pcspecs2")
    Me.TimerInterva l = 0
    End If

    End Sub

    Private Sub Image11_MouseDo wn(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.TimerInterva l = 0
    End Sub[/CODE]
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32634

    #2
    I would forget the TimerInterval code.

    Consider logging the time the mouse is clicked down, then check the Up-time and if the difference is less than 3,000ms then cancel the Click event.

    Does that make sense?

    Comment

    • panteraboy
      New Member
      • Apr 2008
      • 48

      #3
      Thanks yes it does. But i dont know how to retrieve the time of mouse down event or the time of the mouse up event. Is there a form current time property that i can retrieve this info from.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32634

        #4
        timeGetTime() vs Timer() should give you all you need to know.

        If not, let us know the specifics of anything you need help with.

        Comment

        Working...