Results 1 to 4 of 4
  1. #1
    WithoutPause is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    62

    Time out due to inactivity

    http://support.microsoft.com/?kbid=210297



    Here's the only real difference in my code compared to what they have.

    Code:
    Sub IdleTimeDetected(ExpiredMinutes)
    
    
        If Screen.ActiveForm.Dirty Then
            Screen.ActiveForm.Dirty = False
        End If
        
        DoCmd.OpenForm "frmLogin"
        DoCmd.Close acForm, Screen.ActiveForm
    End Sub
    I tried the code to close the application and that works. What I want to do is to see if the form that is being worked on has been idle for a period of time, save what work has been done if any, open the log in form, and close the current form.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    So what is happening? When I look at your code, it seems you are opening and then closing the login form. Maybe you can retrieve the form name from the inactive form somewhere and use the form name in your docmd.close


    dim strName as string

    If Screen.ActiveForm.Dirty Then
    Screen.ActiveForm.Dirty = False

    strName = Screen.ActiveForm.name not sure .Name is the correct property, just guessing here...

    End If

  3. #3
    WithoutPause is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    62
    Name works. I missed the fact that opening the log in form made it the active one.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sometimes all you need is a second set of eyes.

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

Similar Threads

  1. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  2. Replies: 8
    Last Post: 08-24-2012, 01:54 AM
  3. Replies: 1
    Last Post: 08-14-2012, 03:22 AM
  4. Replies: 1
    Last Post: 02-28-2012, 09:16 PM
  5. Replies: 7
    Last Post: 08-04-2011, 07:49 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