The purpose of a query is to extract information from a database and display it on the screen. The purpose of a report, on the other hand, is to extract information and show it on the printed page. So when you need a neatly formatted hard copy of sorted and grouped information, consider using a report.
You can create a blank report by clicking Reports icon in the Object bar, clicking the New button on the database toolbar, and then double-clicking Design View in the New Report dialog box. Access opens a new Report window containing Page Header, Detail, and Page Footer sections. You can then add controls to design the report.
Creating a report is similar to creating a form. You can create a standard report by using the AutoReport command, or you can use the Report Wizard to produce results more tailored to your needs. When you need a specialized report, you can customize one using many of the same techniques you use for forms.
To start exploring reports, let s create a single-table, singlecolumn AutoReport based on the Jobs table:
On the Objects bar, click Tables , and in the Tables list, click Jobs .
On the toolbar, click AutoReport in the New Object button s drop-down list.
After a few seconds, Access displays the report shown in this graphic:
Because reports are usually created to produce printouts, Access displays the report in Print Preview so that you can see what it will look like on the page. (We ve scrolled the window so that you can see two full records.)
Click the Zoom button on the toolbar to zoom out for a bird s-eye view.
The results are shown in this graphic:
Click the Zoom button again to zoom back in.
To see the second page of the report, click the Next Page button to the right of the page indicator in the lower-left corner of the Report window.
Click the Report window s Close button, and click No when asked whether you want to save the report.
You can identify layout problems, such as text length or width exceeding the page s capacity, using Print Preview. You can then change the document s design or modify the page setup before committing the document to paper. Click Page Setup on the File menu to open the Page Setup dialog box. Here, you can adjust the margins, alter page orientation, and select your printer. When you are finished, click OK to apply the new settings. Preview the changes you ve made, and when you are satisfied with the layout, print your document.
The records in the AutoReport were in job order. Suppose you want them organized by customer instead. To create a report that meets this need, use the Report Wizard. Follow these steps:
In the Database window, click Reports on the Objects bar, and then double-click Create report by using wizard .
The Report Wizard s first page, which is shown in this graphic, is displayed:
In the Tables/Queries drop-down list, click Table: Jobs . Click >> to move all the fields to the Selected Fields box, and then click Next .
Click Next on the Report Wizard s second and third pages without making any changes to the default settings. This will instruct Access to automatically sort the records by the CustomerID field.
Access displays the Report Wizard s fourth page, which is shown in this graphic:
Select each of the various Layout and Orientation options, and watch the layout changes in the preview box on the left. When you ve finished, select the Stepped option in the Layout section and the Landscape option in the Orientation section. Then click Next .
The next page appears, as shown in this graphic:
Try out the different styles, and when you have previewed them all, select Corporate , and click Next .
Type Jobs Grouped by Customer as the title for the report, and click Finish to see the results, as shown in this graphic:
Click the Report window s Close button to return to the Database window.
To access the report later, you can click the Reports icon on Objects bar in the Database window and then double-click the report s name .
Just as you can create custom forms to tailor the input of data, you can create custom reports to tailor its output. Customizing reports is beyond the scope of this course; however, you might want to create a report and then switch to Design view to play around with it. To get a feel for some of the possibilities, try moving controls around, formatting labels, or using the buttons on the Toolbox toolbar to add new controls. (Use the structure of the existing controls as a guide.)
To create mailing labels using database information, you create a special kind of report. Select the table you want from the Tables list in the Database window. Click Report in the New Object button s drop-down list, click Label Wizard, and click OK to display the wizard s first page. You can select a label format by company product number. (The default company is Avery; select others from the Filter by manufacturer drop-down list.) You can also select a format by size and number of labels in a row. (The available formats vary, depending on your printer s capabilities.) Select a label size , click Next, format the labels as you want, and then click Next again. Double-click the FirstName field or another appropriate field, press the Spacebar, double-click the LastName field, and press Enter to create a second line. Continue adding fields using the appropriate punctuation and pressing Enter to start new lines. Click Next, move the field with which you want to sort the labels to the Sort by box, and click Next. Assign a name to your report, and click Finish to display the labels in Print Preview. Make any necessary adjustments, and then click the Print button to print your labels.