Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query will not export

Status
Not open for further replies.

kb178

IS-IT--Management
Aug 16, 2001
83
0
0
US
I have a simple query where the only criteria is that one field is true and another is false. I have a button on a form which exports that query to Excel and then updates the false field to true. Here is the code:
DoCmd.OutputTo acOutputQuery, "Query1", acFormatXLS, , True
DoCmd.SetWarnings False
DoCmd.OpenQuery "UpdateQuery"
DoCmd.SetWarnings True

Here is the problem:
In the status bar, you can see that the "Outputting Query" progress bar gets stuck at one bar. Excel opens and says it cannot find the file you saved (obviously because it did not finish exporting). Also, this only happens in the .mde version of the database. It works fine in the .mdb.

The query currently outputs only 170 records. Does anyone know why it could get stuck?

Thanks,
Kristen
 
Kristen,

Have you tried using TransferSpreadsheet?

Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query1", "C:\Export.xls"

Hope this helps.


Leigh Moore
Solutions 4 MS Office Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top