Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2002
    Posts
    12

    Question Unanswered: Closing app for inactive user

    I was wondering if anyone knows how to program an Access 97 application to close itself if a user is inactive for a certain length of time.

    I have an Access front-end database with approx. 30 users (each with their own mdb file) that links to a single back-end mdb file. There is a main menu form that all users keep open at all times. Can anyone help? Thanks in advance for any help you can offer.

    Diane Utter
    City of Olympia, WA

    P.S. As a side, I am working to move this back-end to SQL Server because of problems we are having. More on that another time.

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Diane,

    This can sometimes become problematic. But, with a main form which is always open, things get a LITTLE bit easier.

    This solution involves the use of the TimerInterval property of a form--which is not one of Access' best features ('cause if sucks the horsepower from a client machine).

    Basically, you need to set the TimerInterval property of the main form to 1,000 times the inactive interval, as expressed in seconds. So, for a 30-second interval, you would set this property to 30000.

    Then you need to add event code to the OnTimer event. The first thing you need to add is: me.TimerInterval=0. In other words, you need to shut off the 30-second timer once it has been triggered. You'll need to follow this up with whatever clean-up code you require, terminating with a DoCmd.Quit.

    The real work comes in adding calls to reset that TimerInterval property whenever the user takes an action. So, on every form, you will need to set the KeyPreview property of the form to Yes and you will need to add event code to the OnKeyPress event which reset the TimerInterval on that main form to 30000. And, you will need to reset that TimerInterval property on the MouseDown event of every section and every control on every form.

    Sounds crazy.

  3. #3
    Join Date
    Feb 2002
    Posts
    12
    Thank you. It does sound complicated, but it just might work for us. Most people spend most of their time in a certain form so I wouldn't have to cover every possibility.

    Maybe I can add a pop-up box that lets them keep it from timing out if they are working in a different form or report. If they don't respond to that, then it will boot them.

    Thanks for the help. I hope I'll have some time soon to try it out.

  4. #4
    Join Date
    Dec 2001
    Posts
    79
    Here's a free example that will shut down Access after a period of inactivity:

    http://www.peterssoftware.com/isd.htm

    Hope this helps,

    Peter De Baets
    Peter's Software - MS Access Tools for Developers
    http://www.peterssoftware.com
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  5. #5
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Peter,

    That is a really creative solution.

    I always find it interesting when someone is able to shift their thinking and approach a problem from a completely fresh angle.

    Thanks.

    Ken

  6. #6
    Join Date
    Feb 2002
    Posts
    12

    Smile

    Peter, Thank you so much for the solution. I really think this will help minimize the problems we've been having with our application due to people keeping their front-end open when they're not using it.

    Diane

Posting Permissions

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