Help with a Close Database command

kiwigirl007

New member
Local time
Yesterday, 19:58
Joined
Nov 17, 2005
Messages
7
Can someone help? I would like to insert a button/command onto one of my forms to close the entire database that is open, but without exiting Access. I have another database that has an Exit button on the switchboard that does this operation, but I cannot seem to find the 'procedure'/VBA anywhere on how to make this operation work. I know how to insert a command button/text box etc, but don't know which one I should use (if any) or if I need to write up a VBA command to do this. Can someone give me some step-by-step ideas? Thanks
 
Hi -

This is pretty easy to do, just use the CloseCurrentDatabase method:

Code:
Private Sub CloseDb_Click()

    CloseCurrentDatabase
    
End Sub

This is used by the Switchboard manager, which may be where you've seen it before.

- g
 
Thanks for the help

It works!! Awesome, thanks so much.
 

Users who are viewing this thread

Back
Top Bottom