Compact And Repair

  • Thread starter Thread starter FP1
  • Start date Start date
F

FP1

DS said:
Is there a way to compact and repair your database from a form and have
Access reopen it's self?
Thanks
DS

I think application.CompactRepair will do it.
 
Is there a way to compact and repair your database from a form and have
Access reopen it's self?
Thanks
DS
 
In
FP1 said:
I think application.CompactRepair will do it.

No, I'm afraid not. As the help entry for that method notes:

<quote>
The source file must not be the current database or be open by any other
user, since calling this method will open the file exclusively.
</quote>

Also, that method always compacts the source file into another file.
The "Compact and Repair" menu item takes care of closing the current
database, compacting it into an output file, deleting the original file,
and renaming the output file to the original name. At least, I think it
does it that way, rather than copying the compacted output file over the
original and then deleting it.
 
Back
Top