filter report based on results IN a query (vba or report filter)
Posted on 2012-04-09
Is it possible to filter a report based on the results IN a query?
I have a report based on a table that has say 10 companies. One of those companies has an "Exclude from Printing" flag set on the master company table. So, I query the MasterCompany table, where "Exclude from Printing" <> True. I'll call this query Query1
Then when the report is requested, I want to print only the companies that appear in the results of Query1.
I can't get the syntax working:
DoCmd.OpenReport MyReport, acPreview, [Company] in,'"Query1"'