• Shut down Access After a Fixed Period of Inactivity

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Shut down Access After a Fixed Period of Inactivity

    Author
    Topic
    #461578

    Not if there is an easy way of doing this.

    I would like to be able to shut down an access database after a period of inactivity.
    No facility in Access as far as I know,
    other than maybe bodging something together with a timer event on a hidden form.
    However, I suspect that doing it this way would have performance overheads,
    and still not sure how I would monitor all possible activity.

    Anyone know if this is possible?

    Viewing 0 reply threads
    Author
    Replies
    • #1171684

      See How to detect User Idle Time or Inactivity in Access 2000 (works in later versions of Access too). In that example, the code just puts up a message box after a specified time of inactivity (defined as: the user hasn’t moved to a different control or to a different form), but you can have it perform another action such as quitting Access.

      Note: the example uses a hidden form with an On Timer event and a TimerInterval of 1000, i.e. 1000 ms = 1 second. I’d make the TimerInterval considerably larger, for example 30000 (=30 seconds) or 60000 (=1 minute) to minimize the overhead.

      • #1171689

        See How to detect User Idle Time or Inactivity in Access 2000 (works in later versions of Access too). In that example, the code just puts up a message box after a specified time of inactivity (defined as: the user hasn’t moved to a different control or to a different form), but you can have it perform another action such as quitting Access.

        Note: the example uses a hidden form with an On Timer event and a TimerInterval of 1000, i.e. 1000 ms = 1 second. I’d make the TimerInterval considerably larger, for example 30000 (=30 seconds) or 60000 (=1 minute) to minimize the overhead.


        Thanks Hans

        I also found a Freeware Application

        Inactive Shut Down Control Freeware for Access 97, 2000, 2002, 2003 v2.1

        From Peter’s Software – MS Access Shareware and Freeware for Developers

        Looks like it uses a similar approach to handling the process.

        Anyway, going to give it a go and see what happens.

      • #1171857

        See How to detect User Idle Time or Inactivity in Access 2000 (works in later versions of Access too). In that example, the code just puts up a message box after a specified time of inactivity (defined as: the user hasn’t moved to a different control or to a different form), but you can have it perform another action such as quitting Access.

        Note: the example uses a hidden form with an On Timer event and a TimerInterval of 1000, i.e. 1000 ms = 1 second. I’d make the TimerInterval considerably larger, for example 30000 (=30 seconds) or 60000 (=1 minute) to minimize the overhead.

        I took the above link and followed the instructions. Very kewl! However, I tried setting it up to read the time interval from a table so that I can change the time out dynamically.

        I tried switching “Const IDLEMINUTES = 15” to “Const IDLEMINUTES = intTO” where intTO is dim’d as an Integer. I get “Constant expression required” when compiling.

        Any ideas are greatly appreciated.

        Ken

        • #1171859

          You cannot assign a value to a constant dynamically. Change it to a variable: instead of

          Const IDLEMINUTES = 15 ‘ or intTo

          use

          Dim IDLEMINUTES As Integer

          and asssign the value in the procedure where you read the value from the table:

          IDLEMINUTES = intTo

          • #1171862

            You cannot assign a value to a constant dynamically. Change it to a variable: instead of

            Const IDLEMINUTES = 15 ‘ or intTo

            use

            Dim IDLEMINUTES As Integer

            and asssign the value in the procedure where you read the value from the table:

            IDLEMINUTES = intTo

            Thank you Hans. I will make the change.

            Once again you come to the rescue.

            Ken

    Viewing 0 reply threads
    Reply To: Shut down Access After a Fixed Period of Inactivity

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: