I have seen many questions, in the many forums I ‘watch’, that ask about closing a database after a certain amount of inactivity. The solution is usually to create a process which monitors the Active Form, and the Active Control, to determine if someone is doing something. This is a little flaky though, because what if someone is looking at a report, they could be going through hundreds of pages, and there would be no change in the Active Form, or Active Control….but it’s still database activity. Also, what if they were writing a small novellette within a Memo field. Again, no change in Active Form/Control, but still database activity.
I am attaching a sample database, which monitors actual Keyboard and Mouse activity within an Access session. With the attached database, you will find one form, which will display how long it has been since there has been any mouse/keyboard activity. Move the mouse, the ‘timer’ will reset. Hit the keyboard, again, it resets. Do nothing, and the timer just counts up.
Just thought I would share this…..