473,586 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing Database using a Quit Button

13 New Member
I have designed a database and have used the following code to disable the standard Microsoft close button. I want my users to have to click on a Quit button on the switchboard:

Private Sub Form_Unload(Can cel As Integer)
Dim LResponse As Integer

LResponse = MsgBox("Please Use Quit Button on Main Menu", vbOKOnly)
If LResponse = vbOK Then
Cancel = True
End If

End Sub

They get a pop-up reminder that they have to press OK on - which works well - nothing closes. The problem is that they then get the same reminder when they actually press the Quit button - when the press OK it then closes the database, but I want it to close without having to have this pop-up on the Quit Click.
Anyone got any code for this?
Thanks!
EAC
Mar 27 '08 #1
1 1125
SoNew
13 New Member
MOVING TO ACCESS VBA.
CLOSE Thread
Mar 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2151
by: Marcus Schneider | last post by:
Normally I close my windows/widgets with destroy and it works fine. Now I have a window (let's call it 1) from where I open an additional window (let's call it 2). I close it. Each window has its own main loop. Now I want to open another window outside the mainloop of window 1. So I quit that mainloop, go to a new window, destroy that, enter...
8
9272
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the python wrapper module for sockets, and found that the close command doesn't actually call the underlying close! this didn't seem right, so i added...
1
3819
by: Nathan Bloom | last post by:
Is there a way to force the user of a database to exit and close access through a close button on for example a switchboard menu? If a user closes access by the exit command or the close button on access, this will prevent certain housekeeping routines to function unless thay quit through the database. Another alternative would be to also...
5
3037
by: nick_faye | last post by:
Hi, I am still a newbie to VB and using MS Access 2000. I am currently trying to provide a preview of reports before printing them. My program is simple: AC.DoCmd.OpenReport "MyReport", acViewPreview AC.Visible = True AC.DoCmd.ShowToolbar "Print Preview", acToolbarNo AC.DoCmd.ShowToolbar "Menu Bar", acToolbarNo
22
7558
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....
2
21134
by: AA Arens | last post by:
I have a button which exits the database, but it actually Closes the base, because Access is still active. How to have it exitting the Access app. as well?
8
2056
by: flickimp | last post by:
Hi Have set up a databasde with a quit command button for the user. When the user closes the database, the databse compacts and repairs itself (using the standard tools option). Now then.... initially when you open the database you have to enter a password. When the user clicks the close button the datanse asks for the password again...
2
2205
by: SoNew | last post by:
I have designed a database and have used the following code to disable the standard Microsoft close button. I want my users to have to click on a Quit button on the switchboard: Private Sub Form_Unload(Cancel As Integer) Dim LResponse As Integer LResponse = MsgBox("Please Use Quit Button on Main Menu", vbOKOnly) If LResponse = vbOK Then...
10
1818
by: John | last post by:
Hi My app does a few processes and the app can not be closes mid way. Therefore I want to be able to block any attempt of closing app by user such as by clicking on close (cross) or Alt-F4 and once the app is finished doing what it is doing to close. In other words I need to close the app gracefully. How can I achieve this? Thanks
0
7911
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...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
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...
1
7954
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...
0
8215
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...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3836
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...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.