Microsoft KB Archive/210576

= ACC2000: How to Implement a dBASE-Style REPORT FORM Command in Visual Basic for Applications =

Article ID: 210576

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q210576



This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
This article demonstrates how to implement a dBASE-style REPORT FORM command in Visual Basic for Applications.



MORE INFORMATION
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

Keywords: kbhowto kbprint kbprogramming KB210576

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.