In dBASE, you create a report with the Report Generator, and then print
the report from a program with the REPORT FORM TO PRINT command. In Microsoft Access, you print a pre-existing report programmatically
with
DoCmd.OpenReport.
For example, suppose that you created a report in Microsoft Access named
MyReport, and you wanted to print the report from a Visual Basic procedure. You would run the following command to do this:
DoCmd.OpenReport "MyReport"
If you omit the TO PRINT clause, which is optional in dBASE's REPORT FORM
command, the report is printed to the screen. This is equivalent to
showing the report in Print Preview mode, rather than sending it to the
printer. This can be done with
DoCmd.OpenReport by adding the
acViewPreview parameter:
DoCmd.OpenReport "MyReport", acViewPreview
In addition, with the
acViewDesign parameter, you can open a report in Design view:
DoCmd.OpenReport "MyReport", acViewDesign