Disable quit X button or run vba on quit X button

  • Thread starter Marcus.Schwarz \(removethis\)
  • Start date
M

Marcus.Schwarz \(removethis\)

Is there a way to disable the X in the top right hand
corner of Access (the close Access X button) ? Or, is
there a way that on quit (using the X) a VB script can run?
What I'm trying to do is make a database copy itself to
another location every time it is closed. So it makes a
backup each time you close it.
I can do it if the user uses the quit button, but I can't
stop them using the X button. Is this possible you think?
 
G

Greg Kraushaar

Yes.
Just set some code in one of the forms that prevents the form closing
Form Unload event... cancel = true.
You will never be able shut down Access without resorting to the kill
switch

I kleave it as an exercise for you to control this behaviour so that
it shuts down when and how you want it to

HTH
 

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