Vlad:
Ok, attached is a more complete mock example of my database. Naturally, do keep in mind that the included objects (and data) are only a "tip of the iceberg". However, I wanted to include the "login" form and "main menu" in the event they've been interfering with the "IDLE Shutdown" process.
Upon downloading the zipped file, follow the steps as described below:
- Open Frontend via CTRL+Shift and re-link the tables from the backend
- Close DB and open normally (w/o CTRL+Shift); user the following credentials for login purposes: Username = "Doe, John"; Password = "admin"
- Next, in the [Admin] listbox, use the "Unhide Ribbon..." (or "Hide Ribbon...") to display/hide the table/query objects.
Changes Made to Vlad's Original Example:
- Changed name of table "tblSettings" to "T904_Admin_Settings"; placed the table into BE and then linked it to FE
- Changed name of table "tmpCurrentSessions" to "tblLocalCurrentSessions" but kept table in FE
- Changed name of all four (4) queries starting with "Q105_N1S_Step1 ..." through "Q105_N1S_Step4 ..."
- Performed a FIND/REPLACE on table & queries name throughout the project to ensure all previous name references are updated throughout the DB (I'm 99% confident I located all references).
- Form "F103_N1S_DatabaseUsage": Added the DLookup control on form; added subs Form_Timer() and IdleTimeDetected(ExpiredMinutes) to VBA
- Module "M06_DB_Startup": Replaced the module in the sample DB with module from your zipped file; removed some of the commented lines (bottom of VBA).
- Lastly, replaced data/content in table "T902_Admin_SystemUserTracking" with different data set. Please see attached JPG for details WRT to ID 2 where DbExit had "03/05/2020 07:52 AM" but does NOT get replaced with a value again. **
Note: In this example (i.e, ID 2), DbEntry was 07:51" and DbExit was (prior to manual deletion) "07:52". Now, record #3 has DbEntry = "07:52". That would mean that ID 2 would receive 07:52 - 2 min = 07:50. Obviously, that doesn't make any sense given the DbEntry = 07:51.
Again, please keep in mind that I arbitrarily deleted the 07:52 in ID 2. Not sure if that's the issue as to why it doesn't get re-populated (i.e, DbExit is before DbEntry... logically, that's impossible). Ultimately, I'd be okay to change to "-1" or even "-0" if that were to make a difference.
In summary, here are the missing pieces that I couldn't get to work:
1. The DB did NOT shut down after 1 min of inactivity (i.e., I logged into DB and did not select any action from the main menu).
2. I deleted ID's 2 DbExit but the process never replaced the value again.
Any final assistance in this matter would be greatly appreciated!
Cheers,
Tom