By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,723 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,723 IT Pros & Developers. It's quick & easy.

How to prevent Access app from closing with X button?

P: n/a
Hi folks,

I believe I have seen this in this group in the past but my search
comes up with nothing so far.

I want to prevent our Access application from closing without some
kind of confirmation from the user.

We already have a tiny hidden form that loads from a function called
by the autoexec macro. I KNOW it is loading because I placed a
Debug.Assert IsOpen("formname") at the end of the function. That
Debug.assert works every time. In the Close event of the hidden
form, I placed a boolean choice bloc that asks the user if they are
sure they want to close the application. Even with a breakpoint set,
I cannot get that close event to fire when the app is closed by
Docmd.quit or when the user clicks the X button.

What am I doing wrong? All replies much appreciated.

--LW
Jan 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Lauren Wilson wrote:
Hi folks,

I believe I have seen this in this group in the past but my search
comes up with nothing so far.

I want to prevent our Access application from closing without some
kind of confirmation from the user.

We already have a tiny hidden form that loads from a function called
by the autoexec macro. I KNOW it is loading because I placed a
Debug.Assert IsOpen("formname") at the end of the function. That
Debug.assert works every time. In the Close event of the hidden
form, I placed a boolean choice bloc that asks the user if they are
sure they want to close the application. Even with a breakpoint set,
I cannot get that close event to fire when the app is closed by
Docmd.quit or when the user clicks the X button.

What am I doing wrong? All replies much appreciated.

--LW


Something pretty basic. The unload and close events for all open objects
definitely do fire when Access is closed. Perhaps you should post your code.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Jan 20 '06 #2

P: n/a
On Fri, 20 Jan 2006 02:15:05 GMT, "Rick Brandt"
<ri*********@hotmail.com> wrote:
Lauren Wilson wrote:
Hi folks,

I believe I have seen this in this group in the past but my search
comes up with nothing so far.

I want to prevent our Access application from closing without some
kind of confirmation from the user.

We already have a tiny hidden form that loads from a function called
by the autoexec macro. I KNOW it is loading because I placed a
Debug.Assert IsOpen("formname") at the end of the function. That
Debug.assert works every time. In the Close event of the hidden
form, I placed a boolean choice bloc that asks the user if they are
sure they want to close the application. Even with a breakpoint set,
I cannot get that close event to fire when the app is closed by
Docmd.quit or when the user clicks the X button.

What am I doing wrong? All replies much appreciated.

--LW


Something pretty basic. The unload and close events for all open objects
definitely do fire when Access is closed. Perhaps you should post your code.


Thanks for your response. Actually, I figured it out. The Close
event has no cancel option. The Unload event does. My code works
perfectly when I move it to the Unload event and cancel it if the user
response is no.
Jan 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.