Board index » Visual Studio » Timer and Time
|
Kerc
|
Timer and Time
Visual Studio334
Hi, I have another issue. I have a timer on the main form in VB 6. On form load the system if the SQL have any records it will open the frmWarning. This is working fine. If the user closes the frmWarning without fixing the problem the timer is activated. The time the user closes the form, the "t" is set to the current time in munites. Now if the minutes is 47 current time then t= 47+35 =82, I am adding plus 35 so that the program will open the frmWarning again after 35 minutes, there is no such minutes as 82, because the "s" at the bottom after 59 its value will be 0 . What can I do to fix this and make it work? Thanks Dib Dim s,t 'On Form Load t = Format(Time, "N") + 35 Timer1.Enabled = True Timer1.Interval = 100 Timer1.Enabled = True DoEvents frmWarning.Show frmWarning.ZOrder 'Timer sub s = Format(Time, "N") - 1 If t = s Then t = Format(Time, "N") + 35 frmWarning.Show ' Timer1.Enabled = True ElseIf t>Format(Time, "N") - 1 Then ' Timer1.Enabled = False End If - |
