Print a Report

If you want VBA to print a report from the current database, use the syntax

DoCmd.OpenReport "reportName", acViewNormal where reportName is the name of any report in the current database. For example, the following statement prints a report named MyLabels:

DoCmd.OpenReport "MyLabels", acViewNormal

Figure 16-2:

A question in the screen with Yes/No buttons.

In case you hadn't noticed, the DoCmd (pronounced do command) object shows up quite a few times in this chapter. That's because the DoCmd object lets you do lots of useful things with the tables, queries, forms, and reports in your database. In fact, now that I think of it, I suppose item number ten here should be. . . .

0 0

Post a comment