Couldn't find code anywhere to close/exit access - so thought I'd post it. I think you can use the button wizard to create a button to do this too, but I usually don't use the wizards and go straight to event code. This is something I've used many times in my databases - surprised it wasn't a FAQ already.
This code is behind a button click event. It closes the form and then exits access. Note - I use this for an Exit button on the Main Menu or Switchboard screen. If you use this code somewhere else, I would add code to close any open database objects, before exiting access, to prevent database corruption. Not that it would, but you never know with Access...
Create form and add button called cmdExitDatabase. Add this code to the on click event for the button.
Private Sub cmdExitDatabase_Click() On Error GoTo Err_cmdExitDatabase_Click