Compact and Repair from another database

dgriffis1231

Registered User.
Local time
Today, 11:56
Joined
Oct 9, 2013
Messages
25
I have created an archive process through VBA but when it is finished I need it to compact and repair. I believe I have the code: Docmd.RunCommand acCmdCompactDatabase. However, the trick is the compact and repair is not for the database it is being ran in. I need to run a C&R on an outside source database. Current vba reads:
Sub Archive()
CurrentDb.Execute "APPEND AC_DETAIL"
CurrentDb.Execute "APPEND AC_ECONOMIC"
CurrentDb.Execute "APPEND AC_MONTHLY"
CurrentDb.Execute "APPEND AC_NOTE"
CurrentDb.Execute "APPEND AC_ONELINE"
CurrentDb.Execute "APPEND AC_SCENARIO"
CurrentDb.Execute "APPEND AC_SETUP"
CurrentDb.Execute "APPEND AC_SETUPDATA"
CurrentDb.Execute "APPEND AR_SIDEFILE"
CurrentDb.Execute "APPEND ARCOMMENTS"
CurrentDb.Execute "APPEND ARFILTER"
CurrentDb.Execute "APPEND ARLOOKUP"
CurrentDb.Execute "APPEND ARSTREAM"
CurrentDb.Execute "APPEND ECOPHASE"
CurrentDb.Execute "APPEND ECOSTRM"
CurrentDb.Execute "APPEND GROUPLIST"
CurrentDb.Execute "APPEND GROUPS"
CurrentDb.Execute "APPEND PROJECT"
CurrentDb.Execute "APPEND SELFILTERS"
CurrentDb.Execute "APPEND SUMPROPS"
CurrentDb.Execute "APPEND AC_PROPERTY"
CurrentDb.Execute "APPEND ARENDDATE"
CurrentDb.Execute "APPEND PROJLIST"
CurrentDb.Execute "APPEND SELFILTERS"
CurrentDb.Execute "APPEND SORTTITLE"
CurrentDb.Execute "APPEND AC_PRODUCT"
CurrentDb.Execute "APPEND AC_DAILY"
End Sub

Below is the location and the name of the database:
C:\Users\dgriffis\Desktop\ARCHIVE PROCESS\ARCHIVE PROCESS.mdb

Does anyone have any ideas?

Thank you
DG
 
Cronk,

Thank you for the link. How would I implement the address into the vba?
 
Um, the link tells you what to do, not for it to be inserted into code.
 
Don't worry & no need to take tension you just try third party tool RecoveryFix for Access, this software is reliable for lost your access file and perfect solution to repair damaged access file. For more info you can visit :- accessrepairtool.org and download demo version of the software.
 

Users who are viewing this thread

Back
Top Bottom