Close Current Database Without Exiting Access

  • Thread starter Thread starter Clint Marshall
  • Start date Start date
C

Clint Marshall

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
 
Clint said:
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
 
Clint said:
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
 
Back
Top