Do Event

  • Thread starter Thread starter John Gittins
  • Start date Start date
J

John Gittins

I find that it takes several clicks of the cancel button to get the routine
to stop. Can anyone think how to get it to stop on the first click. The
routine uses the form as a count down clock.

Sub DaysLeft()
Do While TEnd = 0
DaysTG = DateValue("12/17/03") - 1 - DateValue(Now())
HrsTG = Hour("12/17/03 23:59:59") - Hour(Now())
MinsTG = Minute("12/17/03 23:59:59") - Minute(Now())
SecsTG = Second("12/17/03 23:59:59") - Second(Now())
DoEvents
UserForm1.TextBox1 = DaysTG
UserForm1.TextBox2 = HrsTG
UserForm1.TextBox3 = MinsTG
UserForm1.TextBox4 = SecsTG
DoEvents

Loop
Unload UserForm1
End 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

Back
Top