Shut down Access after given time Period

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

Is it possible to shut downa data base say after 15 Minutes if there has been
no activity on a form


Thanks in Advance
 
Nigel said:
Is it possible to shut downa data base say after 15 Minutes if there has been
no activity on a form

Thanks in Advance

you can use the forms onTimer event for this. Basically you would set the
Timer Interval on the form to the specified length of milliseconds and then
in the forms On Timer event enter code to shut down the database. Something
like this should work.

Private Sub Form_Timer()

On Error GoTo Form_Timer_Error
' Close the database
DoCmd.Quit

On Error GoTo 0
Exit Sub

Form_Timer_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_Timer of VBA Document Form_frm:2000RulesTableFilter"

End Sub


Please keeep in mind that this will shut down the database and any changes
that are not saved woll be when the database is shut down.

--
James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
- R Kipling

Message posted via AccessMonster.com
 
I only want it to shut down if there is no change in the last 15 minutes,
this is helpful but anyway to track that
 
Check out this article on Microsoft. It may help. It uses the Detect User
Idle Time

http://support.microsoft.com/default.aspx?scid=kb;en-us;210297

I only want it to shut down if there is no change in the last 15 minutes,
this is helpful but anyway to track that
[quoted text clipped - 24 lines]
Please keeep in mind that this will shut down the database and any changes
that are not saved woll be when the database is shut down.

--
James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
- R Kipling

Message posted via AccessMonster.com
 
Back
Top