Thread: Printing Report
04-10-02, 23:52 #1Registered User
- Join Date
- Apr 2002
Unanswered: Printing Report
I am making a form to print a report. I use Filter and FilterOn property to filter the report. This works well and I got the correct result when I print preview it. However, when I print it, it gives me the whole records, rather than the filtered one. Does anyone know why this occurs ? It seems a bit strange, because usually if the print preview is right, the printing must also be right.
My code is :
DoCmd.OpenReport report_name, acViewPreview,"",""
Reports(report_name).Filter = str_filter
Reports(report_name).FilterOn = True
DoCmd.SelectObject acReport, report_name, False --> multiple reports
Is it true that grouplevel property can only be modified at runtime at Report's Open event ? If that's the case, if we want to modify it again, we have to close the report and open it again ?
06-05-02, 10:34 #2Registered User
- Join Date
- Jun 2002
- Central New Jersey
Assuming your code is behind a button on the form, just have 2 buttons...one for preview and one to print.
For the preview button, use your same code but remove the PRINT line at the bottom. For the print button, re-use your preview code but remove the preview syntax and replace it with the print syntax.
HTH"There's never enough time to do it right, but there's always enough time to do it over!"