Quit Access
acCmdExit
This example closes Access completely. Access will prompt to save any unsaved changes.
To try this example out, create a button on a form and call it cmdExit. Put the following code behind the On Click event.
'***************** Code Start *******************
Private Sub cmdExit_Click()
RunCommand acCmdExit
End Sub
'****************** Code End ********************