Runtime error 3011

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhavesh Devgan
    New Member
    • Jun 2007
    • 1

    Runtime error 3011

    Hi all, am having a runtime error while exportnig data by running a query through TransferSpreads heet command

    Error it shows:
    object could not be found 'Select * from [Volumes_Data] where [Volumes_Data].[Month] =200704

    The relevant code is:

    Dim strQuery As String
    strMonth = cmbMonth.Value
    strQuery = ("Select * from [Volumes_Data] where [Volumes_Data].[Month] =" & strMonth)
    DoCmd.TransferS preadsheet acExport, acSpreadsheetTy peExcel8, strQuery, strOutputFile & "Silo_Repor t"
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    From the MSDN doco, entry on TransferSpreads heet method...

    Also, you must pass a table or saved query to the TransferSpreads heet method — you can't create a query on the fly by passing in an SQL statement

    Comment

    Working...