Close, Save and Compact

N

Neil

I have the following code on a button which saves and closes the DB:-

Private Sub QuitApplication_Click()
On Error GoTo Err_QuitApplication_Click

If MsgBox("Are you sure you want to exit PROMAS?", vbYesNo + vbQuestion,
"Quit Application?") = vbYes Then
DoCmd.Quit acQuitSaveAll

End If

Exit_QuitApplication_Click:
Exit Sub
Err_QuitApplication_Click:
MsgBox Err.Description
Resume Exit_QuitApplication_Click
End Sub



Now, in addition to this, I'd like for the database to actually be compacted
when closed. Could anybody please edit my code so that the DB also compacts?

Thanks in advance
 

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