compress the database everytime when I quit the database ,

M

Martin

I want to make this:

everytime I quit my database, it will automatically compress itself.

How to make it possible?

Thanks!

Martin
 
R

Rainbow01

In your Startup Forms , say "MainMenu", in OnOpen Event in this form:

Application.SetOption "Auto Compact", True

"SAm" 來函:
 
S

SAm

i got an error after inserting the following code on my startup form:

Private Sub Form_Open()
On Error GoTo Err_Form_Open

Application.SetOption "Compact on Close", True


Exit_Form_Open:
Exit Sub

Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
 
S

SAm

sorry, on this one too:

Private Sub Form_Open()
On Error GoTo Err_Form_Open

Application.SetOption "auto compact", True


Exit_Form_Open:
Exit Sub

Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
 
V

Van T. Dinh

The option name may be case-sensitive.

Try:

Application.SetOption "Auto Compact", True

(tested OK in A2002 & A2003)
 
Top