timerinterval = 0

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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top