I tried your code and it didn't work either.
Does the form need to have a text box in it to record the expired time to?
You do not need a a check box. A static variable will suffice.
Describe "does not work"

Signature
Dave Hargis, Microsoft Access MVP
> I tried your code and it didn't work either.
> Does the form need to have a text box in it to record the expired time to?
I just added the code to my test database and got it working. There was one
syntax error. The Dim statement for ??? had a typo. Also, the time is
adding seconds and the constant was looking at minutes, so I changed it to
look at seconds. In the code as is, it is set to 60 (1 minute), so if you
want to give them 30 minutes, it would needa value of 1800. Here is the
corrected version:
'IDLESECONDS determines how much time to wait before
'running the IdleTimeDetected subroutine.
Const IDLESECONDS As Long = 60
Static PrevControlName As String
Static PrevFormName As String
Static ExpiredTime As Long
Dim ActiveFormName As String
Dim ActiveControlName As String
On Error Resume Next
'Get the active form and control name.
ActiveFormName = Screen.ActiveForm.Name
ActiveControlName = Screen.ActiveControl.Name
If ActiveFormName <> PrevFormName Or _
ActiveControlName <> PrevControlName Then
PrevControlName = ActiveControlName
PrevFormName = ActiveFormName
ExpiredTime = 0
Else
'...otherwise the user was idle during the time interval, so
'increment the total expired time.
ExpiredTime = ExpiredTime + 1
End If
'Does the total expired time exceed the IDLESECONDS?
If ExpiredTime >= IDLESECONDS Then
DoCmd.Quit
End If

Signature
Dave Hargis, Microsoft Access MVP
> I tried your code and it didn't work either.
> Does the form need to have a text box in it to record the expired time to?
John V - 01 May 2008 17:21 GMT
It works now that I changed everything to reflect the time in seconds.
Thanks so much for your help
John