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 TouchToneTommy 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 button 5

Status
Not open for further replies.

Ricjd

Programmer
Sep 12, 2002
104
GB
Hey i need a button on a form that when you rpess it it performs the compact and repair function on the current database.

i tried using the docmd.domenuitem but can't find the compact and repair option and also i've tried the application.compactrepair but it says you can't preform this operation on an open database. if you close the database it stops the code.

does any1 have any ideas

thanking you in advance
rick
 
You can't do this....but as a work around, you can open a new database that has one autoexec macro...this closes the (current) database, compacts, reopens it, and closes itself...I have done this several times...and it works like a charm...you you want and example, send me an email and I will forward you the databases...minus any data as they are sensitive. Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Just a simple idea you can automatically compact the database everytime you close it. You probably already know that but just in case you dont click tools/options/General Tab/Compact On Close.

Like i say you probably knew that but just in case

Andy
 
Thanks Robert, you get the star as this is just what I needed too! Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top