Execute Code on Application Exit? 
Author Message
 Execute Code on Application Exit?

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



Sun, 15 May 2005 08:52:46 GMT  
 Execute Code on Application Exit?
The usual method is to open a hidden form at startup and put your
"application exit" code in the Close event of that form.  Leave the
form open while the application is open.  When the user closes the
application, Access closes all open forms, including your hidden form,
so the code runs at that time.

By the way, you cross-posted your question to *way* too many unrelated
newsgroups.  Please try to be more selective.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


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




Sun, 15 May 2005 09:10:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing code on exit.

2. Invoke Java application and catch exit code???

3. Exit Code of MS-DOS Application

4. Exit Codes from VB Application.

5. How determine Exit-Code of Shelled DOS-Application ?

6. Return an exit-code from a running VB 6 application

7. How do I code a menu Exit to exit

8. Can VB return exit code on program termination as exit(X) in C

9. Executing Application within ASP Code

10. Executing MS Access Code from VB application

11. Waiting for an application to finish executing before executing next app

12. How: end code (something like exit code in C)

 

 
Powered by phpBB® Forum Software