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]