countdown timer!!!

johnyjassi

Registered User.
Local time
Yesterday, 16:26
Joined
Jun 6, 2008
Messages
64
Hi guys!

in addition to my previously solved problem, some experts helped me with the countdown timer of 20 mins on click of the button. It is working good, but when i try to click on another button it should stop but it doesn't. Please help me to solve it. I would appreciate any help.
Thanks!
 
Is the button on the same form?

If so then just use Me.TimerInterval = 0
 
First of all thanks for the reply.
Yes button is on same form
Yes, it stops but when I press the start button again it continue from the time it was stopped, i want that when i click start button again after clicking end, it should start from the begining. any help
 
You really should have put this requirement in your original post on the subject, johnyjassi! Okay, here's what you need to do:

In your Sub Form_Timer(), remove the line

Static Loops As Integer

Next, at the top of your code module, just under your Option statement, place the line

Public Loops As Integer

Finally, in the OnClick code for any button that when clicked, you want to stop the countdown timer and reset it to 20 minutes, place code like this:

Code:
Private Sub AnyCommandButton_Click()
  TimerInterval = 0
  Loops = 0
  TimeLeft = ""
End Sub
Now, when you click on one of these buttons, the countdown will stop, the time in the textbox will be erased, and the next time you start the countdown it will restart at 20 minutes.

BTW, just so anyone who wanders into this thread looking for help on countdown timers knows what we're talking about, here's johnyjassi's original post:

http://www.access-programmers.co.uk/forums/showthread.php?t=152580
 
Last edited:
Thanks for your reply, and its working. and sorry for not explaining it for the first time. Thanks a lot!!!!!!!!!!
 
No problem! Glad you got it working to your satisfaction!
 

Users who are viewing this thread

Back
Top Bottom