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

Compacting a Database while inside it

Status
Not open for further replies.

Sech

Programmer
Jul 5, 2002
137
GB
Now I know this subject has been talked about multiple times in the forum before but there are a couple of things I would like to ask. Firstly, the code below has been suggested to compact a database you are inside.

SendKeys "%W1"
SendKeys "%TDC"

This works fine when the normal menu bar is displayed while viewing the database window. However when the database is actually opened properly this code does not work (I presume because of the changes in the menu bar options). Once the database is complete I will be using my own created menu bar with barely any options on it anyhow.

Does anyone know how to get this compacting command to work while running the database properly with the database window hidden?

My other question concerns what this code actually does. It closes the database, compacts it and then re-opens it. Does anyone know how to just close and compact it without re-opening as if so I could then include it on the Exit button of the database.

Also if anyone knows of any other alternative suggestions while still using VBA code or macros I would be very interested.

Thanks all
 
i would also like to know how to do that...

it would be a very usefull to allow the user to compact the DB from a custom menu.

thanks
Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top