Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 20th, 2006, 02:15 AM
Lauren Wilson
Guest
 
Posts: n/a
Default How to prevent Access app from closing with X button?

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
  #2  
Old January 20th, 2006, 02:25 AM
Rick Brandt
Guest
 
Posts: n/a
Default Re: How to prevent Access app from closing with X button?

Lauren Wilson wrote:[color=blue]
> 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[/color]

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


  #3  
Old January 20th, 2006, 07:25 AM
Lauren Wilson
Guest
 
Posts: n/a
Default Re: Re: How to prevent Access app from closing with X button?

On Fri, 20 Jan 2006 02:15:05 GMT, "Rick Brandt"
<rickbrandt2@hotmail.com> wrote:
[color=blue]
>Lauren Wilson wrote:[color=green]
>> 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[/color]
>
>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.[/color]

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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles