OK, so I came across this bit of code from the Microsoft website (https://support.microsoft.com/en-us/kb/128814, with a more recent update at http://www.blueclaw-db.com/user_inactivity_logoff.htm).
I understand how to modify it to adjust the timing involved (i.e. how often to check, how long will be 'too long' for the user to be idle, etc.). However...rather than have the code close out the application, I need it to modify a table, reset itself, & keep going.
The idea is to track how many people will be using a math tutoring lab, & their purpose for the lab (out of 6 possible options). The reports need to be able to show both summary & detail data of how many people are using the lab in a given hour (20, 30, 50, etc.), how many users are coming to the lab for each of the 6 reasons (3 for reason #1, 6 for reason #2, etc.), & the average time the user is in the lab. Since at least 2 of the reasons for coming to this lab will involve college placement testing, they can't just "log in" with their usual student login & password, nor be tracked by the classes they're registered in; because of the nature of the placement testing, the majority of them won't be signed into any classes yet, let alone be assigned logins/emails for the college's servers. But I still need to distinguish them, not only from each other but also from themselves -- for example, if someone comes into the lab for an hour, leaves & comes back for another 20 minutes, leaves again & comes back a 3rd time for 40 minutes, it's going to count on the report as 3 separate visits to the lab.
Now, I'm working on designing the form to allow them to check in & out of the lab. But...these are typical college students, not typical computer science students, so I can't assume that they'll always remember to check out when they're done in the lab. Nor can I allow the system to assume that anyone still logged in when the lab closes was actually there.
I was thinking that, since the data will be tracked in a table, I could remove the part of the code that gets the "active" form & control. But would I be able to have it check the table fields instead...or would I be better off designing a module that a) checks all rows for the day to see if any rows are missing a departure time, & b) if the departure time is missing & the difference between the current time & the row's "arrival time" is greater than an hour, automatically give it a departure time that defaults to an hour spent in the lab?