Results 1 to 5 of 5
  1. #1
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52

    Idle Time fix

    Database20.zip



    Hi

    I am trying to do the instructions in the following link which is close the database after idle. I think it might be the module part i have wrong as I am not confident with them. http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx

    I have attached what I have done so far. Would someone mind having a quick look to see what I'm doing wrong. This is a sample database before input on my real one.

    Thanks in advanced.

    Ross

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    This example they gave assumes you are only using 1 form. If your app uses more than 1 form, leaving the timer form will continue to countdown, even tho the user is not idle.

    So, You would need a global variables
    public const gkIDLEMINUTES = 5
    public gvElapsed

    then you wiould need a public ResetTime() function to reset the elapsed time for:
    every mouse move event
    every keydown event
    on every form
    to reset the elapsed time.

    When all forms are idle, and global gvElapsed = gkIDLEMINUTES then docmd.quit

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    There were a couple of errors....
    The top two lines of every module should be:
    Option Compare Database
    Option Explicit
    ' << this line was missing

    Did you try doing a Debug/Compile? You had two "End Subs" in the timer code.
    The code in Module1 should have been in the form module.


    I changed the elapsed time from 5 minutes to 1 minute - I didn't want to wait that long.

  4. #4
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52
    Thanks Steve for your help.

    Sorry to be pain. Do you know how to automatically log them out becase is just shows the message and until OK is pressed then the DB will remain open.
    Regards

    Ross

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Don't use the built in message box command.

    You could make your own message box: create a form, set the form properties (Modal, color, size, etc), add a text box for the message, start another timer (in the message box form), close Access (move the Docmd.Quit command into the new message box code).

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 09-04-2014, 01:52 PM
  2. Replies: 2
    Last Post: 08-21-2014, 08:36 AM
  3. Replies: 5
    Last Post: 07-24-2014, 07:54 AM
  4. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  5. Replies: 1
    Last Post: 02-28-2012, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums