S
Simeon
Hi folks,
I am trying to solve a problem with the compressing of an Access 2003
database just before I close it. For now I wrote this sub procedure, which
enables the automatic compressing if a file has reached a certain filesize:
Public Sub dbcompress(filesize As Long)
If FileLen(CurrentDb.Name) > filesize * 1024 * 1024 Then
Application.SetOption ("Auto Compact"), 1
Else
Application.SetOption ("Auto Compact"), 0
End If
Exit_dbcompress:
Exit Sub
Err_dbcompress:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_dbcompress
End Sub
The problem is an error message I get before Access is closed. After closing
the current database the compress process is started and the after a while
this error message appears bevor the compress process has ended:
"You can't close MS Office Access right now. If you are executing a VB
module which uses DDE or OLE you have to cancel it first"
I would be thankful for an advice how to remove the error message.
Simeon
I am trying to solve a problem with the compressing of an Access 2003
database just before I close it. For now I wrote this sub procedure, which
enables the automatic compressing if a file has reached a certain filesize:
Public Sub dbcompress(filesize As Long)
If FileLen(CurrentDb.Name) > filesize * 1024 * 1024 Then
Application.SetOption ("Auto Compact"), 1
Else
Application.SetOption ("Auto Compact"), 0
End If
Exit_dbcompress:
Exit Sub
Err_dbcompress:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_dbcompress
End Sub
The problem is an error message I get before Access is closed. After closing
the current database the compress process is started and the after a while
this error message appears bevor the compress process has ended:
"You can't close MS Office Access right now. If you are executing a VB
module which uses DDE or OLE you have to cancel it first"
I would be thankful for an advice how to remove the error message.
Simeon