Closing the database instead of the form is easy, use
docmd.quit
However I provide a warning message before closing ie

Dim response
response = MsgBox("Are You Sure You Want to Quit Access", vbYesNo + vbExclamation + vbDefaultButton2)
If response = vbNo Then Exit Sub ' User chose No.

DoCmd.Quit



As to hiding Access I have seen a couple of methods, one involves Current Database Settings, but not a popup form and the other involves quite complex VBA code requires a popup form.
But the simplest advice I have seen is this one

https://www.alvechurchdata.co.uk/hin...s/acchide.html