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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compact and Repair

Status
Not open for further replies.

MarkNie

Technical User
Sep 22, 2005
102
GB
Hi All

Hope you doing well!!

Don't know if this is possible but is there any way that you can put the compact and repair option into a macro that will compact and repair 2 link data bases with a front and back end. Like say when you import data it could run after that...

I know this is a long shot but does anybody have an Idea.

Thanks
Regards
Mark
 
You can execute a compact and repair on a database with the following:

Call Shell(path to access path to database /compact /repair)

This could be added to a macro (I think) or in the VBA code (which I prefer).

A note here is that this CANNOT be used to compact and repair the database which it is being run from, i.e. if you are in test.mdb, you cannot compact and repair test.mdb with this method.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top