LEHQmjrjjS samPe database for this section is Modified Northwindaccdb

The query qryNorthwindAll links all the tables in the Modified Northwind database. To produce a plain datasheet report, start by selecting qryNorthwindAll, and selecting Report Wizard in the Reports group on the Create tab of the Ribbon, as shown in Figure 1.10.

FIGURE 1.10

Selecting the Report Wizard to create a report.

FIGURE 1.10

Selecting the Report Wizard to create a report.

Select the fields to include on the report (see Figure 1.11) and click Next.

FIGURE 1.11

Selecting fields for a report.

FIGURE 1.11

Selecting fields for a report.

On the next screen of the wizard (see Figure 1.12), select the top-level grouping you want for the report (in this case, I accepted the default selection of OrderQuarter, Customer, OrderDate).

FIGURE 1.12

Selecting a major grouping level for a report.

FIGURE 1.12

Selecting a major grouping level for a report.

The next screen lets you select sub-groups, if desired; I accepted the default (no further sub-grouping, as shown in Figure 1.13).

FIGURE 1.13

Select sub-grouping levels for a report.

FIGURE 1.13

Select sub-grouping levels for a report.

Next, select sorting and summarizing options; I selected ProductName for sorting, as shown in Figure 1.14.

FIGURE 1.14

Selecting sorting and summarizing options for a report.

FIGURE 1.14

Selecting sorting and summarizing options for a report.

On the report layout screen, depicted in Figure 1.15, I selected the Block option.

FIGURE 1.15

Selecting the Block report layout option.

FIGURE 1.15

Selecting the Block report layout option.

Select a style on the next screen, shown in Figure 1.16 (bear in mind that some of the more artistic styles won't look good when printed on a black-and-white printer). I selected None for a plain report.

FIGURE 1.16

Selecting a report style.

FIGURE 1.16

Selecting a report style.

Give the report a name on the Finish screen (Figure 1.17) — I called it rptNorthwindSales. Select the "Modify the report's design" option to open the report in design view, and click Finish.

FIGURE 1.17

The Finish screen of the Report Wizard.

FIGURE 1.17

The Finish screen of the Report Wizard.

You will need to make some adjustments to the report's design in the property sheet; if it is not open, click the Property Sheet button in the Tools group on the Design tab of the Ribbon, as shown in Figure 1.18.

FIGURE 1.18

FIGURE 1.18

Opening the property sheet.

Opening the property sheet.

By default, in the Block report layout only the cells with values have visible borders, so to create an overall worksheet-type layout, select all the controls in the Detail section of the report, and turn off display of duplicate data values by setting the Hide Duplicates property to No on the Format tab of the properties sheet, as shown in Figure 1.19.

FIGURE 1.19

Setting the Hide Duplicates property to No to eliminate duplicate data on a report.

FIGURE 1.19

Although it is generally not a problem for report controls to have the same names as their bound fields (because they are rarely, if ever, referenced in code), I like to give the appropriate tags to the bound controls at least. To do this manually, give the textboxes the prefix txt. (On a report created by the Report Wizard, labels are named with the non-standard suffix _Label.)

0 0

Post a comment