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
===============================
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
===============================