Thanks...I realized this that I copied an older code...Here's the correct code I am using now:
Code:
Option Compare Database
Option Explicit
Public Loops As Integer
Private Sub Form_Load()
Me.TimerInterval = 1000
Form_Timer
End Sub
Private Sub Form_Timer()
Static StartTime As Date
Dim SecondsToCount As Integer
Dim Min As String
Dim Sec As String
SecondsToCount = 900 'Set this variable to the total number of seconds to count down
If Loops = 0 Then StartTime = Time
Min = (SecondsToCount - DateDiff("s", StartTime, Time)) \ 60
Sec = (SecondsToCount - DateDiff("s", StartTime, Time)) Mod 60
Me.TimeLeft.Caption = "Form will close in " & Min & ":" & Format(Sec, "00")
Loops = Loops + 1
If Loops = 675 Then
Me.TimeLeft.ForeColor = vbRed
End If
If Me.TimeLeft.Caption = "Form will close in 0:00" Then
DoCmd.Close , ""
End If
End Sub
I tried to use this to add time:
Code:
Private Sub cmdAddTime_Click()
Loops = Loops + 30
End Sub
This does not work....Any suggestions?