
Execute Function on Access Application Close
When your database opens, have it open a hidden form. Put code in that
hidden form's OnClose event that will cause the information to be written
into the table. When ACCESS closes, it closes all open forms, and that will
trigger the form's code to be run before the database closes.
--
Hoping that this is helpful...
Ken Snell
<MS ACCESS MVP>
Quote:
> Basically all I want to do is write to a log file, when a
> user enters or exits my access database, recording
> username and time logged on/off to the Access database.
> My problem is I do not know how I can perform code
> execution if the user closes Access from the Quit
> Application click box on the Main Menu bar. I easily can
> have my code executed with a command button for Quit
> Application. But for those users who bypass the command
> button and use Application Close box on the menu bar, I
> can seem to figure how to execute this code for that
> action. Most people just close out the Access database
> rather than use the Quit Command button I have on my main
> form.
> Anyone have any ideas?
> Thanks.
> William