Solved Time Out DataBase Access

georg0307

Registered User.
Local time
Today, 13:26
Joined
Sep 11, 2014
Messages
91
Dear All,

is there any way to set up an access database, that exit after 20 minutes of inactivity?

Could you please suggest the vba code to use?

Thanks in advance,

Best regards,

Georg B:
 
There's a thread on Access World Forums here:-

And there is this answer on Microsoft answers here:-

Haven't really studied them to see how they work, but I think it might give you a Kick in the right direction!
 
Uncle Gizmo gave you exactly webs, I suggest you to Microsoft Idle vba code.
you just copy and paste :
Before you have to create Form and create Micro AutoExce.
Code:
Private Sub Form_Timer()
Static stControlName As String
Static stFormName As String
Static ExpiredTime

Dim AcControlName As String
Dim AcFormName As String
Dim ExpiredMinutes
  
On Error Resume Next
'Get the active form and control name.
AcControlName = Screen.ActiveControl.Name
AcFormName = Screen.ActiveForm.Name

'Disply the text box current form Name
Me.Text0 = AcFormName 
    If (stControlName = "") _
        Or (stFormName = "") _
        Or (AcControlName <> stControlName) _
        Or (AcFormName <> stFormName) Then

        stControlName = AcControlName
        stFormName = AcFormName
        ExpiredTime = 0
    Else
    ExpiredTime = ExpiredTime + Me.TimerInterval     'Interval Time is 1000
    End If

    ExpiredMinutes = (ExpiredTime / 1000)        '60 Second = 1 minutes
    
    'Disply the text box time count seconds
    Me.Text1 = ExpiredMinutes
    
    If ExpiredMinutes >= 10 Then       '10 Second
        ExpiredTime = 0
        Application.Quit acQuitSaveAll
    End If
    
End Sub
 
Hi,

many thanks for prompt answer, will try.

Best regards

Georg B.
 

Users who are viewing this thread

Back
Top Bottom