Problem with Inactivity Detection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    Problem with Inactivity Detection

    Re : Inactivity Detection in Access.

    NeoPa,

    I just encountered a very strange occurrence with this code (using Access 2010).

    First off, this code works. Thanks much for the work you've done.

    However, I have experienced a very strange situation when I run this code on one form, but not the other. I will give an example: I open my DB, which opens the Switchboard Form, which has this function in the timer. I use 30 minutes as the time to kill the DB if the user has not touched the db. After 30 minutees, the DB dies, as expected.

    When I navigate to another form (which also closes the switchboard), which does not have this code in the Timer Event, and I use this form for a long time (i.e. "not idle"), and then close that form (which opens the Switchboard again), the switchboard will appear for a split second and then the DB will quit on me.

    When I used the system idleness (see Post #2), I had no problems, but when I transitioned to an Access-specific idleness, this was the result.

    Any ideas why this would be happening?
    Last edited by NeoPa; Jun 26 '14, 04:27 PM. Reason: Added link and moved to new thread.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    The code, or more correctly the whole process, depends on being run regularly. If you stop running it, but then start it again to continue from where it left off before - which is essentially exactly what you're doing, then it will see :
    1. The situation is the same as last time it checked.
    2. The time since it last logged a change in status was over 30 minutes.

    That's all it needs to determine that the system's been idle for that long.

    Going back to my first sentence, the way to ensure that this process is run continuously is to have a form that it's connected to (In whose Timer procedure it runs.) which never stops being open during the life of the session. To handle this it is simply necessary that when it's not required on the screen it gets hidden rather than closed. Other references to starting it then get changed to unhiding it instead. Having it close and then re-open is not an option that will work very well for you.
    Last edited by NeoPa; Jun 26 '14, 04:22 PM.

    Comment

    • twinnyfo
      Recognized Expert Moderator Specialist
      • Nov 2011
      • 3653

      #3
      NeoPa,

      Very good explanation. It helps me understand the results. Very easy to add a hidden form that nobody ever sees.

      Thanks for the quick response!

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        Very pleased to hear that Twinny.

        The timing is more random than anything else, but always (extra) happy to help a site Expert :-)

        Status update on its way. Only bureaucracy holding up the process (IE. No-one around who can do it for now :-D).

        Comment

        Working...