473,700 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("formnam e") 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
2 2438
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("formnam e") 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
On Fri, 20 Jan 2006 02:15:05 GMT, "Rick Brandt"
<ri*********@ho tmail.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("formnam e") 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1026
by: ajay | last post by:
How can i prevent a model form from closing on click of ok button which is of model type using C# in windows form.
0
1231
by: George Ivanov | last post by:
How to prevent exiting application after clicking the OK button on Pocket PC? I can handle the event but can't stop the application from closing. *** Sent via Developersdex http://www.developersdex.com ***
6
6584
by: Miguelito Bain | last post by:
hi everybody- i have a form with 2 fields on it that i want the user to fill out before he or she can save the record, close the record, or move to the next record, etc... here's the code i tried. if i just enter minutes and click close, the form closes. it seems to bypass my nested if statement.
22
7570
by: alecjames1 | last post by:
I have a form which the user must complete before closing. I have disabled the window x button and use my own exit button. When selected it checks to see if the user has completed the entries otherwise it cancels the close. However, the user can still right click on the task bar and close my application. Is there any way of preventing this. Thanks Alex
6
5848
by: Malcolm Webb | last post by:
I have experimented with the routine to prevent access from closing using the module authored by Dev Ashish to be found at "The Access web" site. Whilst this seems to work, it is not exactly what I would like to do. My database has an Exit&Backup routine called from the exit button on my Main Menu. It is a simple form with options to backup to a choice of specified drives, cancel or exit without backup. What I would really like to...
3
6439
by: 007 | last post by:
I have a FixedToolWindow form that I create and display when the user presses a button on the toolbar. I want to prevent Alt+F4 on the FixedToolWindow form. How do I accomplish this? I want the only way to close the FixedToolWindow form is by clicking on the toolbar button again. It's a bit like pressing "Search" on IE's toolbar. BTW why is the ToolBar that comes with VS.NET so ugly? It's like the old style toolbar.
5
10472
by: freelancex | last post by:
Hi, Im new to this forum, and new to scripting in general. Im an ICT Technician for a high school and i am designing a Form in visual basic 2005. The intended purpose of the Form, is to prevent student users logging on to their area, without accepting the Acceptable Use Policy which comes up on screen. The form, runs maximized, in full screen mode and is constantly in focus, above all other programs. So Basically, until the form is...
7
5234
by: Michiel Rapati-Kekkonen | last post by:
Hi, I would like my record to be saved only when my own close button (with all it's checks) is used. I made the winodws close button disappear, but you still can close using the right mouse click. also when designing, going to design mode saves the record. So I tried: OnClose : Me.Undo. My own cancel button uses it and it works ok,
5
5891
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of the screen. I have been unable to find any way to disable this button in Access 2007 and subsequently I have been forced to find ways to detect and handle the situations after the Access Close button has been clicked. I have been largely...
0
8725
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9074
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8924
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5902
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4656
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3088
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.