I want to log users starting and leaving the database. I undertand the standard way to detect closure of a database is to load a hidden form at startup and include an Unload event for that form, however this does not work for me.
At startup I include
This contains
mod_ExecuteMyCommand() is a working procedure.
At startup I include
Code:
DoCmd.OpenForm "frmDatabaseIsInUse", acNormal, , , , acHidden
This contains
Code:
Private Sub Form_Unload(Cancel As Integer)
Call mod_ExecuteMyCommand("INSERT INTO tbLog VALUES(" & Str(pubAuditor_i) & ",'" & Format(Now, "yyyy-mm-dd hh:NN:ss") & "','Application closed')")
DoCmd.Quit
End Sub
mod_ExecuteMyCommand() is a working procedure.