473,395 Members | 1,938 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,395 software developers and data experts.

Exit Access

I have a button on my switchboard that say's exit. for now all it does
it exit the current application and keeps access open. i was wondering
if there was any code that when i press this button it causes access to
close as well.
Any help is greatly appreciated.

Aug 2 '06 #1
5 43466
you mean

DoCmd.Quit

doesn't work?

Aug 2 '06 #2

pi********@hotmail.com wrote:
you mean

DoCmd.Quit

doesn't work?
My question is how would i get that into the button. i used the
database utilities to create the switchboard and i used the exit
application command in the switchboard manager. i was wondering how i
could get that code into the exit application or would i have to create
code in vba and then insert it into the command.

Aug 3 '06 #3
Hi Enginer

You have to select the button, right click on it, then select
properties.

Select the 'Event' bookmark tab, then click on the elipis (the three
fullstops at the end of the line). A vba windows should open and the
code in there should look something like:

Private Sub btnExit_Click()
Docmd.Close
End Sub

Change it to:

Private Sub btnExit_Click()
If MsgBox("Are you sure that you want to quit this database?",
vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then
Docmd.Quit
End If
End Sub

Good luck,

Nick

enginerd477 wrote:
pi********@hotmail.com wrote:
you mean

DoCmd.Quit

doesn't work?

My question is how would i get that into the button. i used the
database utilities to create the switchboard and i used the exit
application command in the switchboard manager. i was wondering how i
could get that code into the exit application or would i have to create
code in vba and then insert it into the command.
Aug 3 '06 #4
Nick,

That did it for me. Now if i don't want the message box can i make the
code just

Docmd.Quit

Thanks again for the help.

Nick 'The Database Guy' wrote:
Hi Enginer

You have to select the button, right click on it, then select
properties.

Select the 'Event' bookmark tab, then click on the elipis (the three
fullstops at the end of the line). A vba windows should open and the
code in there should look something like:

Private Sub btnExit_Click()
Docmd.Close
End Sub

Change it to:

Private Sub btnExit_Click()
If MsgBox("Are you sure that you want to quit this database?",
vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then
Docmd.Quit
End If
End Sub

Good luck,

Nick

enginerd477 wrote:
pi********@hotmail.com wrote:
you mean
>
DoCmd.Quit
>
doesn't work?
My question is how would i get that into the button. i used the
database utilities to create the switchboard and i used the exit
application command in the switchboard manager. i was wondering how i
could get that code into the exit application or would i have to create
code in vba and then insert it into the command.
Aug 3 '06 #5
sure. just make the code

DoCmd.Quit

Aug 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Skully Matjas | last post by:
Even when I exit access it does not exit completely, if i press ctrl-alt- del then i see "msacces" running. sometimes multiple copies. it is so bad that i get errors "not enough memory" so i cant...
9
by: MacDermott | last post by:
I have an Access MDB which instantiates a class in a custom DLL, manipulates it for a while, then sets it equal nothing. The MDB does other things,too, and generally behaves itself as desired....
4
by: Ed Mana | last post by:
I have an Access app that I need to automate in 2 ways: 1. I need to have the app open and print a specific report once each day at a specific time. 2. I need to have the app take the same...
7
by: Paul T. Rong | last post by:
Dear all, It is very close to the end of finishing a database, the last report I am making is kaput, what I want to do is while the report is opening, a dialog form will open first for the user...
11
by: stu | last post by:
I have several databases that are opened using various versions of Access and VB. Up till recently everything worked fine, then I started getting a variety of lock file error messages, both on my...
2
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?
2
by: jsimons | last post by:
If the user accidentally clicks the X close button I'm using the following code in the form unload event to stop them from accidentally quitting Access. Private Sub Form_Unload(Cancel As...
2
by: D Hammer - Sayner | last post by:
I am new to using Access 2007 and a novice with Access period. I have two older databases that I created in Access 2000. When I open DB1 I get the usual ribbon menus shown. When I open DB2...
2
by: dstork | last post by:
Anyone know how to rename the "Exit Access" command at the bottom of the Office menu. I'd like to rename it to "Exit" as I had done in previous versions of Access. I know I can disable it with ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.