Exit database on close of form

G

Guest

Hi All,

When the user exits the "MAIN MENU" I've created, I'd like the database, or
better, MS-Access to close. By making the menu popup and modal, I'm
preventing the user from getting below the menu (to the table links), but I'd
like the db to close when they exit the form - I guess this would be the On
Close Event, but I've not a clue as to how to close the database.

Many Thanks in Advance for your Kind Help.

Pat
 
G

Guest

Pat,

I have multiple forms and each form has a return to previous menu button,
plus a Exit Database button. When i created the buttons, I have it on the
"On Click" to call an event procedure that does the following -

Private Sub Exit_Database_Click()
On Error GoTo Err_Exit_Database_Click


DoCmd.Quit

Exit_Exit_Database_Click:
Exit Sub

Err_Exit_Database_Click:
MsgBox Err.Description
Resume Exit_Exit_Database_Click

End Sub



I hope this helps! :)

VF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top