Results 1 to 6 of 6
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    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?
    Andrew

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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.

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    [quote name='HansV' post='786968' date='31-Jul-2009 12:11']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.[/quote]

    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.

    Andrew

  4. #4
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='786968' date='31-Jul-2009 06:11']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.[/quote]
    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

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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

  6. #6
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='787201' date='02-Aug-2009 11:15']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[/quote]
    Thank you Hans. I will make the change.

    Once again you come to the rescue.

    Ken

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •