Compact & Repair

voskouee

Registered User.
Local time
Today, 14:58
Joined
Jan 23, 2007
Messages
96
i am using the following code that i found after searching the Forum

Code:
Public Function CompactData()
SendKeys "%(TDC)", False
End Function


Code:
DoCmd.Close acForm, Me.Name, acSaveNo
CompactData


i added it to the exit button. it does close but the size of the database is not getting smaller. its stays the same and its getting bigger and bigger all the time. actually its not a databas that i have its a utilitity with many queries and vba. when i compact and repair from the menu its trims it down to 1.7 mb when i use the code it stays as it is 70 nmd. any ideas why?
 
If you're trying to compact when you close, why not just tell Access to always compact when the database closes, rather than using your own code?
 
Actually i did that.. i set the option on compact on close.. i just found out about it..

thanks guys!
 

Users who are viewing this thread

Back
Top Bottom