Compact And Repair Macro?
If so, how and where would I write the VBA/macro to do what I'm looking to do from the switchboard.
The users do not have access to the regular database controls as I have changed the properties to .accdr, and I have disabled all other ways of exiting the program exceptthrough that one switchboard button (or task manager).
I am still pretty new to access, and actually enjoying it.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Here is where it gets stranger. .problem happens on multiple databases and I can copy the DB to another computer with Access 2007 (Same version) and Compact/Repair works fine.
For problem / attempted corrections I have tried the following with no luck
Checkdsk - OK
Boot in Save Mode - Compact / Repair still crashes
Move DB to another HD on my computer (Thinking I may have disk failing) - Compact / Repair still crashes
Uninstall / Install Access - - Compact / Repair still crashes
I have a split database; how often should you compact the FE? How often should you compact the BE? I would like to run a batch file through task manager to trigger the back end compact late at night so no one can open it.
The back end has a security password set; when I do a command line compact repair in task manager it starts to work then stops at the password input box. How can I add this password to a batch file so it can complete the compact and repair. I see through the posts that you should back up the DB first. Can someone help me with the batch file to include a back up then compact the DB?
Spookily the table now has exactly 20000 records in it, which makes me think this is some kind of limit, except that I dont think there are table limits in Access and I have other tables in the database with more than this number of records that are still ok.
Is there any way of recovering the data after a compact & repair?
Any ideas why the compact repair would have deleted these records? (It hasnt happenned with previous compact repairs)
I dont have a recent backup of the database, but thats a different problem!
Kindly help me in solving this issue else tell me some other solution to eliminate this issue and resolve it.
I keep seeing warnings about using the automatic compact and repair in the Access Options of 2007. However, I'm worried about data bloat if this is never done.
Does anyone out there have experience with Access 2007 Runtime using the automatic compact and repair?
Public Sub CompactDB()
CommandBars("Menu Bar"). _
Controls("Database utilities"). _
Controls("Compact and repair database.."). _
But for some reason this doesn't work in MS Access 2007. That might be because MS Access 2007 does not have a Menu Bar.
How would I write the code to manipulate the menus in 2007 to compact and repair the database. This is a stand alone database.