Results 1 to 2 of 2

Thread: Printing Report

  1. #1
    Join Date
    Apr 2002
    Posts
    168

    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
    DoCmd.Printout

    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 ?

  2. #2
    Join Date
    Jun 2002
    Location
    Central New Jersey
    Posts
    69
    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!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •