• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Timer event disabled after Break

If you break (hit Cntl+Break) in the middle of a Form Timer event procedure and Select 'End', the timer event will no longer fire until you close and reopen the form. This is unexpected to me. Can anyone explain why this happens and how to prevent it (ie how to automatically reactivate the timer).
0
Milewskp
Asked:
Milewskp
  • 2
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
from VBA help

Timer Function Example
This example uses the Timer function to pause the application. The example also uses DoEvents to yield to other processes during the pause.

Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
    PauseTime = 5    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
    Finish = Timer    ' Set end time.
    TotalTime = Finish - Start    ' Calculate total time.
    MsgBox "Paused for " & TotalTime & " seconds"
Else
    End
End If

0
 
MilewskpAuthor Commented:
Hi Cap,
I'm talking about the Timer event forforms, not the Timer function.
0
 
Rey Obrero (Capricorn1)Commented:
<the timer event will no longer fire until you close and reopen the form.>

the timer event for the form is most likely called in the open or load event of the form
0
 
MilewskpAuthor Commented:
Thanks cap - full points to you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now