Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compact DB in code

Status
Not open for further replies.

hirenJ

Programmer
Dec 17, 2001
72
0
0
GB
Hi all, I am using the code below to compact & repair when the user clicks the exit app button --

im getting an error that this action cannot be performed whilst VB code or macros are being run -- how else can I compact on exit?

Hj



===========================

Private Sub cmdClose_Click()
Call CloseForm
'code to quit app, and compact database


DoCmd.RunCommand acCmdCompactDatabase
DoCmd.RunCommand acCmdRepairDatabase
If conversioncomplete Then
DoCmd.RunCommand acCmdExit
End If

End Sub
===============================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top