473,383 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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
Jan 20 '06 #1
2 2410
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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
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...
6
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...
22
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...
6
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...
3
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...
5
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...
7
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...
5
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.