Kicking out users after inactivity
I just received an email thanking me for the Auto FE Updater and expressing a certain amount of annoyance at users who don’t exit Access at the end of the day.
I use the following to kick users out so I can make changes to the back end after hours.
HOW TO: Detect User Idle Time or Inactivity in Access 2000 (Q210297)
However we found that the code which runs on the timer event must be disabled for the programmers. Otherwise weird things start happening when you're editing code. Use the following function to enable it for users. Assuming you give your users an MDE/ADE/ACCDE. (I don’t know where I got the following code from.)
Public Function IsMDE() As Boolean
Dim db As DAO.Database
On Error GoTo tagError
Set db = CurrentDb
If db.Properties("MDE") = "T" Then
IsMDE = True
db.Close: Set db = Nothing
On Error GoTo 0
Select Case Err.Number
Case 3270 ' Property not found
IsMDE = False
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure IsMDE of Module mdltt_FixReferences"
Also print preview would sometimes not allow the users to run a menu item to export the report to Excel or others. So you had to right click on the Previewed report to get some type of internal focus back on the report so they could then export it. This was also helped by extending the timer to five minutes.
The downside to extending the timer to five minutes was if a person stays in the same form and at the same control for considerable parts of the day, i.e. someone doing the same inquiries, the routine didn't realize that they had actually done something. I'll be putting in some logic sometime to reset this timer whenever they do something in the program.