I got this code from rolf.gerlicher(at)gmx.de
You call IdleTime() and get the duration in tick from the last time the
Keyboard was pressed or mouse was moved.
I think
http://support.microsoft.com/default.aspx?scid=kb;en-us;210297, if
Ms Access is not active application and user is working with another
application, it will consider idle time. Depend on your need, you can use one
of these two idle detection methods.
Private Type PLASTINPUTINFO
cbSize As Long
dwTime As Long
End Type
Private m_typPLII As PLASTINPUTINFO
Private Declare Function GetTickCount Lib "kernel32" () As Long
Public Function IdleTime() As Long
On Error GoTo IdleTime_ErrHandler
m_typPLII.dwTime = 0
m_typPLII.cbSize = Len(m_typPLII)
GetLastInputInfo m_typPLII
IdleTime = GetTickCount() - m_typPLII.dwTime
IdleTime_NormalExit:
Exit Function
IdleTime_ErrHandler:
MsgBox Err.Description & ". Error number = " & Err.Number & ". Error is in
IdleTime."
Resume IdleTime_NormalExit
End Function
Regards
Tran Hong Quang
www.bicsoft.net