VBA Compact repair all databases in a folder

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,146
Hi

Is there a vba code I can use that opens up each access dB in a folder and does a compact and repair) and then closes the db

I am trying to run this every week to keep my databases clean and lean
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,146
I can run from excel too

for each dB in dbfolder
open dB
Compact repair
Close dB
Next dB

Some like this
 

Watch MrExcel Video

Forum statistics

Threads
1,102,565
Messages
5,487,592
Members
407,605
Latest member
PACULA

This Week's Hot Topics

Top