Detecting when user closes application or database

  • Thread starter Thread starter John C.
  • Start date Start date
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)?
 
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.
 
Back
Top