[AccessD] TransferSpreasheet Problem

Dan Waters dwaters at usinternet.com
Wed Feb 3 13:21:02 CST 2010


Hi Rocky,

I had this same (or similar) issue once.  There is a known bug in Access
which will prevent an OutputTo method from working if the database is
running but has not yet opened any object (form, query, report).  See
KB244695.

I use an 'OutputTo' method instead of TransferSpreadsheet:

  DoCmd.OpenQuery "qryGlobalErrorsToDeveloper"
        
  DoCmd.OutputTo acOutputQuery, "qryGlobalErrorsToDeveloper", acFormatXLS,
stgClientPath

  DoCmd.Close acQuery, "qryGlobalErrorsToDeveloper"

Good Luck!
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Wednesday, February 03, 2010 1:07 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] TransferSpreasheet Problem

Dear List:

In the line:

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strSQL,
strFrontEndPath & "ExportedAuditTrail", True


strSQL = "Select * FROM tblAuditTrail" where tblAuditTrail is a linked
table.

I get an error message The Microsoft Jet Database engine could not find the
object 'Select * FROM tblAuditTrail'.  

Can you not use a SQL statement as the query for export?

I can't put this into a query because the user can filter on several fields
so I build those filters into the SQL statement using
WHERE...AND...AND...etc.

MTIA

 

Rocky Smolin

Beach Access Software

858-259-4334

www.e-z-mrp.com <http://www.e-z-mrp.com/> 

www.bchacc.com <http://www.bchacc.com/> 

 

 





More information about the AccessD mailing list