I need to generate a timer code in VB that counts down from 3600000 miliseconds (1 hour) to 0 miliseconds.But it's not allowing value to exceed 65000 something....my present code is as follows.....

Private Sub Timer1_Timer()
If Label2.Caption = 0 Then
Timer1.Enabled = False
MsgBox ("1 Hour is up")
Label2.Caption = Label2.Caption - 1
End If
End Sub

Please pleeeeeaseeeee help me......!!!

Thankkkkk you!!!!! :)

8 Years
Discussion Span
Last Post by Drycola

I did not understand what exactly your code does, but here is a simple solution:

Set the timer interval to 60000 millisecond (1 minute)
Declare a new variable and let it be MyVar
We'll increase the variable each minute, when it reaches 60, that will be an hour
Here's the code:

Option Explicit
Dim MyVar as Integer

Private Sub Timer1_Timer()
MyVar = MyVar + 1
If MyVar = 60 Then
     Timer1.Enabled = False
     Msgbox "1 Hour is up."
End If
End Sub

And I'm ready for any further help!

Note: If this problem is solved, then please mark this thread as solved. Thanks.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.