How To Output access Report with Condition

前端 未结 2 1137
花落未央
花落未央 2021-01-24 01:26

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

2条回答
  •  無奈伤痛
    2021-01-24 01:41

    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.

提交回复
热议问题