Autoeng
Why me?
- Local time
- Today, 03:58
- Joined
- Aug 13, 2002
- Messages
- 1,302
I have a database that if I set the option to compact on close it is creating a default (db1.mdb, db2, db3, ect.) database copy. It does not do it if I do not compact on close.
The only code I have is an Autoexec module.
The Excel file that it exports has 24,000 rows but only 4 columns. It does not have any problem exporting the file. When the database is closed however the database copies itself.
Any clue why?
The only code I have is an Autoexec module.
Code:
Option Compare Database
'------------------------------------------------------------
' Autoexec
'
'------------------------------------------------------------
Function Autoexec()
DoCmd.SetWarnings False
On Error Resume Next
Kill "S:\mydirectory\tbl1009QA.xls"
DoCmd.OpenQuery "qrytbl1009", acViewNormal, acEdit
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblqry1009QA", "s:\mydirectory\tbl1009QA.xls"
DoCmd.OpenTable "tbl1009QA", acViewNormal, acEdit
DoCmd.Maximize
DoCmd.GoToRecord , "", acNewRec
DoCmd.SetWarnings True
End Function
The Excel file that it exports has 24,000 rows but only 4 columns. It does not have any problem exporting the file. When the database is closed however the database copies itself.
Any clue why?