Compact ad repair

aymanmb

Registered User.
Local time
Today, 21:01
Joined
Jan 28, 2007
Messages
96
I have a macro that will copy the database to a folder upon quiting.

The databse also is enabled from the options to compact and repair upon exit.

Problem is the copied databse will be always not compacted becaue the macro will run 1st before quiting (and hence before compacting).

is there a way around it
 
In your macro, add a sendkeys event before the copy event. In the Keystrokes property, put %T D C and that will compact the DB without closing it first.
 
thanks, I tried it and gave me a message that you can not compact the open database while running a macro or visual basic code.

I saw in the macro an action option to comact the database. Is it safe to use and does it do same thing as compact and repair (repair part is missing)
 
I tried it also, same message.

so how is Access is compacting and reapiring upon exit (when you set it up to do so automatically from the databse options).

how can we do so then run the backup macro???????
 
The macro to do the compact has three actions:

SetWarnings Off
SendKeys %T D C
SetWarnings On

I just dropped that into a macro and double-clicked the macro to run it, and it was fine. I did this in Access 2003.
 

Users who are viewing this thread

Back
Top Bottom