Good Day Dears
I Have a Form To Run Report With Condition When I Run The Form The Filter(Condition) Work Correctly For Report
But When I Create PDF( DoCmd.Output
Whenever you open the report, its filters the data based on query and shows the result as desired. The problem is, to execute the Docmd.OutputTo
you first have to close the report and as the reports closes the filter effects gets cleared and output pdf will contain all the records.
Solution is if you don't want to preview the report then you can use acHidden
instead of acDialog
, otherwise if you really want to preview the report and then want to export as pdf then on the form put a button and code that button to export the report as PDF.