I have the following code set up in Access97 to automatically compact the database on exit. Occassionally, when executing, I get an "Out of Stack Space" error. I know this is usually due to a memory propblem but I have 256 MB of memory. It doesn't seem to matter what else I have running or how long I have been in the database.
Thanks, Bill
Public Sub CompactDB()
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}", True 'The compact from db
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}" & "y", True 'The compact to db.
'SendKeys "{Enter}", False
'SendKeys "Y", False
DoEvents
DoCmd.RunCommand acCmdCompactDatabase
Backup
End Sub
Thanks, Bill
Public Sub CompactDB()
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}", True 'The compact from db
SendKeys ("C:\My Documents\Asset GB1.mde" & "{Enter}" & "y", True 'The compact to db.
'SendKeys "{Enter}", False
'SendKeys "Y", False
DoEvents
DoCmd.RunCommand acCmdCompactDatabase
Backup
End Sub