timerinterval = 0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a start up form which shuts down the application if nothing is done
within a given amount of time. Each time the mouse moves or keys are pressed,
the timer is reset to start again. No problems so far. Once a 'continue'
button is pressed, the form's visible property is set to No and another form
is opened. I need to stop the Timer event from triggering at this point, so
before the form goes 'invisible' it's TimerInterval is set to 0 via VBA code
- TimerInterval = 0.
This isn't working. If I step through the code, it works fine, but at run
time it quits the app as defined in the OnTimer event. I've tried using
variables and constants to set the property and replacing TimerInterval with
Me.TimerInterval, but no luck.
Any ideas?

TIA
Dave
 
Setting the TimerInterval to 0 should stop the timer from running again, but
won't stop it from running the code if it is currently being run from the
previous TimerInterval triggering the code. Where is the Continue form being
called from? You may need a hidden textbox on the form that you put a value
in when you click the Continue button. Since you are hiding the form, not
closing it, you can check for this value before exiting in the Timer code.
If the value exists, Exit Sub.
 
Back
Top