By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,589 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,589 IT Pros & Developers. It's quick & easy.

Runtime error 3011

P: 1
Hi all, am having a runtime error while exportnig data by running a query through TransferSpreadsheet 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.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, strQuery, strOutputFile & "Silo_Report"
Jun 20 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
From the MSDN doco, entry on TransferSpreadsheet method...

Also, you must pass a table or saved query to the TransferSpreadsheet method you can't create a query on the fly by passing in an SQL statement
Jun 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.