I found this article on this forum. The guy wanted to set the timer interval to close the database in 12 hours. He wanted the maximum number for the timer. The respondent suggested an alternative method. I would like to use this. Can you tell me how to create the procedure “intAppMinutes?”
START OF ARTICLE
I would create a "Public Variable" in a module to increment by one until it reached 720 which is the amount of minutes in 12 hours. When the variable reachs 720 ... close the app.
Here is the Public Variable for the module:
Public intAppMinutes As Integer
Now here is a sample on the code needed in the forms' On Timer event:
<Code>
Private Sub Form_Timer()
Dim strMsg As String, strTitle As String
If intAppMinutes = 720 Then
MsgBox strMsg, vbExclamation + vbOKOnly, strTitle
DoCmd.Quit
Else
intAppMinutes = intAppMinutes + 1
End If
</Code>
END OF ARTICLE
Thanks.
START OF ARTICLE
I would create a "Public Variable" in a module to increment by one until it reached 720 which is the amount of minutes in 12 hours. When the variable reachs 720 ... close the app.
Here is the Public Variable for the module:
Public intAppMinutes As Integer
Now here is a sample on the code needed in the forms' On Timer event:
<Code>
Private Sub Form_Timer()
Dim strMsg As String, strTitle As String
If intAppMinutes = 720 Then
MsgBox strMsg, vbExclamation + vbOKOnly, strTitle
DoCmd.Quit
Else
intAppMinutes = intAppMinutes + 1
End If
</Code>
END OF ARTICLE
Thanks.