How does one detect when an application is bieng close BY closing a window?


J

JHB

Hi:

I have an application that does various things when it is closed in
the correct way by clicking a STOP button. However, some users have
been closing it by clicking the "Close Window" box (the "X") at the
top right of the window (windows XP). I am running Access 2000, and
wonder if here is any way to detect when someone trys to close the
main window (thereby closing the app) so that I can trigger some
actions when that takes place. For example, I would like to ask the
users if they wish to save certain conditions before the application
is shut down.

Any help would be appreciated. I have searched around and dont find
anything about this on the web, byt it must be a common problem.

best

John Baker
 
Ad

Advertisements

J

John W. Vinson

Hi:

I have an application that does various things when it is closed in
the correct way by clicking a STOP button. However, some users have
been closing it by clicking the "Close Window" box (the "X") at the
top right of the window (windows XP). I am running Access 2000, and
wonder if here is any way to detect when someone trys to close the
main window (thereby closing the app) so that I can trigger some
actions when that takes place. For example, I would like to ask the
users if they wish to save certain conditions before the application
is shut down.

Any help would be appreciated. I have searched around and dont find
anything about this on the web, byt it must be a common problem.

best

John Baker

One way to do this is to have a form which is always open (e.g. the default
form for the database, or a form opened from that form's Open event); it can
be set with its Visible property set to No so the user can't see it (or close
it). You can then put code in its Close event, to fire when the user closes
the database.

--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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