Close the Database With the Timer (1 Viewer)

Learn2010

Registered User.
Local time
Today, 03:23
Joined
Sep 15, 2010
Messages
415
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:23
Joined
May 7, 2009
Messages
19,169
create a standard module
add the variable :

public intAppMinutes as long

***
now the timer interval shoul be set to 60000 (1minute)
 

Learn2010

Registered User.
Local time
Today, 03:23
Joined
Sep 15, 2010
Messages
415
Works like a charm.

Thanks.
 

Users who are viewing this thread

Top Bottom