Detecting when user closes application or database

J

John C.

I have a database that has numerous users. I have code to
detect who (userid) and where (machineid) they are. I
place an entry into a table with their name, machineid,
and date/time start use.

I need to detect when the user closes the database or
application.

There are several ways to close the application...
(1) Clicking the "X" in the upper right corner.
(2) Double clicking application symbol in the upper left.
(3) Keyboard keystrokes.

Can/how do I trap each of these?
Can I disable them (not desired)?
 
R

Rick Brandt

John C. said:
I have a database that has numerous users. I have code to
detect who (userid) and where (machineid) they are. I
place an entry into a table with their name, machineid,
and date/time start use.

I need to detect when the user closes the database or
application.

There are several ways to close the application...
(1) Clicking the "X" in the upper right corner.
(2) Double clicking application symbol in the upper left.
(3) Keyboard keystrokes.

Can/how do I trap each of these?
Can I disable them (not desired)?

Open a form hidden at startup and leave it open the entire session. You can use
its Close event to make a log entry. Regardless of how the app is closed (short
of reset and the power switch) the form's Close event will fire.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top