How to avoid user to close my Access program?

E

Egg

Dear All,

I am using Access XP (Access 2002) to make my program and use the developer
run time program to delivery my program. In my main form, I can set the
close button to "No" to avoid user to quit the program, but the user can
still use the Access close button (on the top right cross button) to close
the program.

Any way to avoid use close the program? Any suggestion will be highly
appreciated. Thank you.


Daryl
 
R

Rick Brandt

Egg said:
Dear All,

I am using Access XP (Access 2002) to make my program and use the
developer run time program to delivery my program. In my main form, I
can set the close button to "No" to avoid user to quit the program,
but the user can still use the Access close button (on the top right
cross button) to close the program.

Any way to avoid use close the program? Any suggestion will be highly
appreciated. Thank you.


Daryl

If you cancel the Unload event of a form that is always open (or a hidden one
used just for this purpose) then Access will not close. At least not until the
user opens TaskManager and kills it that way.
 
T

Tony Toews [MVP]

Egg said:
Any way to avoid use close the program? Any suggestion will be highly
appreciated. Thank you.

Why? What's the problem with the user closing the Access app?

If you have some logic that must be done before closing the app then
put it in the OnClose event of a hidden form you open on startup.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
E

Egg

Because my program need to run 24 hours, and at night time some tasks will
be done automatically. So if user close the program, it might be some
problem.

Daryl
 
T

Tony Toews [MVP]

Egg said:
Because my program need to run 24 hours, and at night time some tasks will
be done automatically. So if user close the program, it might be some
problem.

Gotcha. Good reason.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
?

=?windows-1250?Q?Vladim=EDr_Cvajniga?=

Hi, Daryl,

don't forget to add a routine that enables you to interrupt program
execution, eg. when you want to install new version. :)

Vlado
 

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