Private Sub Form_Timer()
Static stControlName As String
Static stFormName As String
Static ExpiredTime
Dim AcControlName As String
Dim AcFormName As String
Dim ExpiredMinutes
On Error Resume Next
'Get the active form and control name.
AcControlName = Screen.ActiveControl.Name
AcFormName = Screen.ActiveForm.Name
'Disply the text box current form Name
Me.Text0 = AcFormName
If (stControlName = "") _
Or (stFormName = "") _
Or (AcControlName <> stControlName) _
Or (AcFormName <> stFormName) Then
stControlName = AcControlName
stFormName = AcFormName
ExpiredTime = 0
Else
ExpiredTime = ExpiredTime + Me.TimerInterval 'Interval Time is 1000
End If
ExpiredMinutes = (ExpiredTime / 1000) '60 Second = 1 minutes
'Disply the text box time count seconds
Me.Text1 = ExpiredMinutes
If ExpiredMinutes >= 10 Then '10 Second
ExpiredTime = 0
Application.Quit acQuitSaveAll
End If
End Sub