Using the Report Command


Access 2007 includes a new quick create Report command that makes it easy for you to quickly create quality reports. Similar to the quick create form commands, the Report command is a one-step process-you’re not presented with any options or dialog boxes; Access simply creates a generic report with one click. You can use either a table or query as the base for the report. We’ll create two quick reports to illustrate this process using the ContactsDataCopy.accdb sample database.

Open ContactsDataCopy.accdb, click the Navigation Pane menu, click Object Type under Navigate To Category, and then click Queries under Filter By Group to display a list of queries available in this database. The qryContacts query includes all the fields from the tblContacts table and sorts them by last name and then first name. Let’s create a nice report of your contacts using this query. Scroll down to this query in the Navigation Pane, select it, and then click the Report command in the Reports group on the Create tab, as shown in Figure 15–17.

image from book
Figure 15–17: Click the Report command to let Access build a report using the qryContacts query.

After just a second or two, Access 2007 creates an entire report with all the fields in the query, complete with a logo, a title, the current date and time, a colored line beneath the column labels, and even a page count at the bottom of the pages, as shown in Figure 15–18. (You can best see the page count in Print Preview.) Access opens the report in Layout view so that you can begin the process of making modifications.

image from book
Figure 15–18: With one click, Access creates an entire formatted report for your convenience.

If you look closely at the report, you’ll also see that there are significant problems with this layout. Access spread all the fields out in a tabular control layout. If you switch to Print Preview, you can see that this report would not be easy to read because the data in many columns wraps to multiple lines, and you have to scan across three pages to find all the data for each contact. If the number of contact records were even larger, the report would be extremely hard to follow. Access did much of the hard work for you in creating the report, but you still need to make many modifications in either Layout view or Design view to make the report readable. (We’ll discuss Layout view in more detail later in this chapter.) Close this report now, and don’t save it when prompted.

The qlkpProducts query includes all the fields from the tblProducts table and sorts them by product name. Select this query in the Navigation Pane and then click the Report command in the Reports group on the Create tab. Access 2007 creates another report very similar to the first one, as shown in Figure 15–19.

image from book
Figure 15–19: This report is easier to understand than the one created on a more complex query.

This query has only six fields, so Access was able to do a better job of laying out the fields horizontally. However, the Expire field and part of the Price field spill over onto a second page. Using the techniques you learned earlier in this chapter, it would probably take you less than a minute to resize some of the controls to fit everything onto one page and change the title. The rest of the report looks very usable as is. As you can see, the Report command can save you time over starting a report from scratch. Close the report, and don’t save it when prompted.

Inside Out-When to Use the Report Command 

The Report command’s strength is speed, not finesse. As the previous two examples demonstrate, this report option is not suited for all occasions. For complex queries or tables with quite a few fields, it might take you longer to clean up a report created with this one-click approach compared to starting from scratch. Although the Report command does create a simple total for the Price field, it does not create any groups or sorts, so you would have to manually add these. We find that the Report command is best suited for simple tables or queries that do not require a lot of complex report analysis.




Microsoft Office Access 2007 Inside Out
MicrosoftВ® Office Access(TM) 2007 Inside Out (Microsoft Office Access Inside Out)
ISBN: 0735623252
EAN: 2147483647
Year: 2007
Pages: 234

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net