PC Review


Reply
Thread Tools Rate Thread

Close Current Database Without Exiting Access

 
 
Clint Marshall
Guest
Posts: n/a
 
      25th Jul 2005
I am trying to create a command button on an Access XP form that will close
the current Access database without exiting the Access Application. This is
preferred because it will save time the next time we open another database.

I notice that this functionality isn't available from the file menu. What
I'm trying to achieve is the equivalent of clicking the "x" on the database
window.

I can't figure out the code and it's not available in the command button
wizard.

Can anyone guide me or direct me to the code I need?

Thank you!

-Clint Marshall


 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      25th Jul 2005
Clint Marshall wrote:
> I am trying to create a command button on an Access XP form that will
> close the current Access database without exiting the Access
> Application. This is preferred because it will save time the next
> time we open another database.
> I notice that this functionality isn't available from the file menu. What I'm
> trying to achieve is the equivalent of clicking the "x" on
> the database window.
>
> I can't figure out the code and it's not available in the command
> button wizard.
>
> Can anyone guide me or direct me to the code I need?


Application.CloseCurrentDatabase


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


 
Reply With Quote
 
 
 
 
Clint Marshall
Guest
Posts: n/a
 
      25th Jul 2005
Perfect!
Thank you!

-Clint


"Rick Brandt" <(E-Mail Removed)> wrote in message
news:IdbFe.756$(E-Mail Removed)...
> Clint Marshall wrote:
>> I am trying to create a command button on an Access XP form that will
>> close the current Access database without exiting the Access
>> Application. This is preferred because it will save time the next
>> time we open another database.
>> I notice that this functionality isn't available from the file menu. What
>> I'm trying to achieve is the equivalent of clicking the "x" on
>> the database window.
>>
>> I can't figure out the code and it's not available in the command
>> button wizard.
>>
>> Can anyone guide me or direct me to the code I need?

>
> Application.CloseCurrentDatabase
>
>
> --
> I don't check the Email account attached
> to this message. Send instead to...
> RBrandt at Hunter dot com
>



 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      25th Jul 2005
Clint Marshall wrote:
>I am trying to create a command button on an Access XP form that will close
>the current Access database without exiting the Access Application. This is
>preferred because it will save time the next time we open another database.
>
>I notice that this functionality isn't available from the file menu. What
>I'm trying to achieve is the equivalent of clicking the "x" on the database
>window.
>
>I can't figure out the code and it's not available in the command button
>wizard.
>
>Can anyone guide me or direct me to the code I need?



Closing the Database Window is available in the menus by
first selecting the Database Window and then using the
File - Close menu item.

If you want to do this through a form button, then use:
Application.CloseCurrentDatabase

If you only want to hide the database window, use:
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close all files without exiting Excel jco Microsoft Excel Misc 2 11th Nov 2009 10:16 PM
current week, current month, current year joemeshuggah Microsoft Excel Programming 1 14th Oct 2008 06:44 PM
how can I close a worksheet without exiting the wookbook =?Utf-8?B?R3J1bXB5IFVtcCAx?= Microsoft Excel Misc 2 21st Sep 2007 11:15 PM
How can I close a file without exiting Word? Lately every time I . =?Utf-8?B?TWFyZyBTaGFrZQ==?= Microsoft Word Document Management 3 27th Sep 2005 11:45 AM
Running a Sub and exiting the current one. dht Microsoft Excel Programming 2 22nd Jun 2004 02:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 PM.