Issues with docmd.openquery
Posted on 2010-11-16
I've never run into this issue before, but I created a click event that runs a qry using the following command and then exports the file.
DoCmd.OpenQuery "SalesByRegion", acViewNormal, acEdit
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "TableSbR", "C:\TableSbR.xls", True
It works, but when I run, it opens the query for viewing results instead of just running behind the scenes. I've used thus same code before in other cases and never had it show results.
How do I get it to stop showing the query results?