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

Need help on how to run Access Query with Where Clause

P: 1
DoCmd.OutputTo acOutputQuery, "Production Volume Report_MM", ac_FormatXLS, "C:\Production volume Report.xls"

In the above code "Production Volume Report_MM" is Query already existing in MS Access. Now i want to put the Where clause in the above syntax.
like.
DoCmd.OutputTo acOutputQuery, "Production Volume Report_MM where Period='2011'", ac_FormatXLS, "C:\Production volume Report.xls"

But this code is not working.

Please help me..
May 31 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,315
The outputto function does not allow for an optional where/filter clause. You will need to use a parameter in the query or change the query before you use the outputto.
May 31 '12 #2

Post your reply

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