Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Close Current Database Without Exiting Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Clint Marshall - 25 Jul 2005 20:04 GMT
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
Rick Brandt - 25 Jul 2005 20:39 GMT
> I am trying to create a command button on an Access XP form that will
> close the current Access database without exiting the Access
[quoted text clipped - 8 lines]
>
> Can anyone guide me or direct me to the code I need?

Application.CloseCurrentDatabase

Signature

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

Clint Marshall - 25 Jul 2005 21:03 GMT
Perfect!
Thank you!

-Clint

>> I am trying to create a command button on an Access XP form that will
>> close the current Access database without exiting the Access
[quoted text clipped - 10 lines]
>
> Application.CloseCurrentDatabase
Marshall Barton - 25 Jul 2005 21:19 GMT
>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
[quoted text clipped - 8 lines]
>
>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

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.