troubleshooting Question

Timer calculation in Access Database

Avatar of urjudo
urjudoFlag for United States of America asked on
* CodingMicrosoft Access
9 Comments1 Solution53 ViewsLast Modified:
Hi Experts,
I have a question about the calculation time problem in Access Database for Automatically close the database if the database is idle for a period of time.
How do I calaulate for hour(s)?  I would like to set to if idle for 3 hours then close the database automaticaly.

Is this correct for Calculate mintue? -- > ExpiredMinutes = (ExpiredTime / 1000) / 60    

here is my code in the calculation part:

'I set the timer Interval to 1000
ExpiredTime = ExpiredTime + Me.TimerInterval

    ExpiredMinutes = (ExpiredTime / 1000) ' this is for 1 second
    Me.txtIdleTime = ExpiredMinutes
If ExpiredMinutes >= 10 Then  ' this is for 10 minutes
   ExpiredTime = 0
   Application.Quit acQuitSaveAll
End If

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros