What Report Properties Are Available and Why Use Them?
Reports have many different properties that you can modify to change how the report looks and performs. Like Form properties, Report properties are divided into categories: Format, Data, Event, and Other. To view a report's properties, first select the report, rather than a section of the report, in one of three ways:
- Click the Report Selector, which is the small gray button at the intersection of the horizontal and vertical rulers.
- Select Report from the drop-down in the Properties window.
- Choose Edit, Select Report.
After you have selected a report, you can view and modify its properties.
Working with the Properties Window
When you select the report , the Properties window shows all the properties associated with the report. To select the report and open the Properties window at the same time, double-click the Report Selector. A report has 47 properties available on the property sheet (additional properties are available only from code) broken down into the appropriate categories in the Properties window. Forty of the properties relate to the report's format, data, and other special properties; the remaining seven relate to the events that occur when a report is run. The format, data, and other properties are covered here, and the event properties are covered in Chapter 10.
The Report's Format Properties
A report has the following 23 Format properties for changing the report's physical appearance:
- Caption
The Caption property of the report is the text that appears in the Report window's title bar when the user is previewing the report. You can modify it at runtime to customize it for a particular situation. - Auto Resize
The Auto Resize property was introduced with Access 2002. This setting determines whether a report is resized automatically to display all the data on the report. - Auto Center
The Auto Center property was introduced with Access 2002. You use the Auto Center property to designate whether you want the Report window to automatically be centered on the screen. - Page Header, Page Footer
The Page Header and Page Footer properties determine on what pages these sections appear. The options are All Pages, Not with Rpt Hdr, Not with Rpt Ftr, and Not with Rpt Hdr/Ftr. Because you might not want the Page Header or Page Footer to print on the Report Header or Report Footer pages, these properties give you control over where those sections print. - Grp Keep Together
In Access, you can keep a group of data together on the same page by using the Grp Keep Together property. The Per Page option forces the group of data to remain on the same page, and the Per Column option forces the group of data to remain within a column. A group of data refers to all the data within a report grouping (for example, all the customers in a city). - Border Style
The Border Style property was introduced with Access 2002 reports. Like its form counterpart, it is far more powerful than its name implies. The options for the Border Style property are None, Thin, Sizable, and Dialog. A border style set to None means the report has no border. A Thin border is not resizable; the Size command isn't available in the Control menu. This setting is a good choice for pop-up reports, which remain on top even when other forms or reports are given the focus. A Sizable border is standard for most reports. It includes all the standard options in the Control menu. A Dialog border looks like a Thin border. A report with a border style of Dialog can't be maximized, minimized, or resized. After the border style of a report is set to Dialog, the Maximize, Minimize, and Resize options aren't available in the report's Control menu. - Control Box
The Control Box property was introduced with Access 2002 as well. This property lets you specify whether the Report window under print preview has the Control menu available. The Control menu is activated by clicking the icon in the upper-left corner of a window, and displays options for manipulating the windowRestore, Move, Size, Minimize, Maximize, and Close. - Min Max Buttons
The Min Max Buttons property was also introduced with Access 2002. This property lets you specify whether the Minimize and/or Maximize options should be available from the Control menu for the Report window in Print Preview mode. You can select from None, Min Enabled, Max Enabled, or Both Enabled. - Close Button
The Close Button property was also introduced with Access 2002. This setting specifies whether to enable or disable the close button on the Print Preview window. - Width
The Width property specifies the width of the report sections. - Picture, Picture Type, Picture Size Mode, Picture Alignment, Picture Tiling, and Picture Pages
The background of a report can be a picture. The Picture properties determine what picture is used as a background for the report and what attributes are applied to it. - Grid X/ Grid Y
The Grid X and Grid Y properties determine the density of the gridlines in the Report Design window. - Layout for Print
The Layout for Print property specifies whether screen or printer fonts are used in the report. If you want to optimize reports for preview, select No; if you want to optimize reports for the printer, select Yes. This option is not as important if you select TrueType fonts because TrueType fonts usually print equally well to the screen and printer. - Palette Source
Determines the source for the report's selectable color. - Orientation
Used for taking advantage of language-specific versions of Microsoft Access, such as Arabic. This property can be set to support right-to-left display features for these language-specific editions of Access, provided that the underlying operating system supports that language and is 32-bit (for example, Windows 2000). - Moveable
Determines whether the user can move the Report window around the screen by clicking and dragging the report by its title bar.
The Report's Data Properties
A report has the following five Data properties used to supply information about the data underlying the report:
- Record Source
Specifies the table or query whose data underlies the report. You can modify the record source of a report at runtime. This aspect of the Record Source property makes it easy for you to create generic reports that use different record sources in different situations. - Filter
Allows you to open the report with a specific filter set. I usually prefer to base a report on a query rather than apply a filter to it. At other times, it's more appropriate to base the report on a query, but then apply and remove a filter as required, based on the report's runtime conditions. - Filter On
Determines whether a report filter is applied. If the value of this property is set to No, the Filter property of the report is ignored. - Order By
Determines how the records in a report are sorted when the report is opened. - Order By On
Determines whether the Order By property of the report is used. If the value of this property is No, the report's Order By property is ignored.
The Other Report Properties
A report has 12 Other properties; these miscellaneous properties, explained here, allow you to control other important aspects of the report:
- Record Locks
Determines whether the tables used in producing the report are locked while the report is being run. The two values for this property are No Locks and All Records. No Locks is the default value; it means that no records in the tables underlying the report are locked while the report is being run. Users can modify the underlying data as the report is run, which can be disastrous when running sophisticated reports. Users can change the data in the report as the report is being run, which would make figures for totals and percent of totals invalid. Although the All Records option for this property locks all records in all tables included in the report (thereby preventing data entry while the report is being run), it might be a necessary evil for producing an accurate report. - Date Grouping
Determines how grouping of dates occurs in your report. The US Defaults option means that Access uses United States' defaults for report groupings; therefore, Sunday is the first day of the week, the first week begins January 1, and so on. The Use System Settings option means that date groupings are based on the locale set in the Control Panel's Regional Settings, rather than on U.S. defaults. - Pop Up
Determines whether the report's print preview window opens as a pop-up window. Within Microsoft Access, pop-up windows always remain on top of other open windows. - Modal
Instructs Access to open the Report window in a modal or modeless state. The default is No, meaning that the window will not be opened as modal. A modal window retains the application program's focus until the window receives the appropriate user input that it requires. - Menu Bar
Allows you to associate a custom menu bar with the report that's visible when the user is previewing the report. Adding a custom menu to your report lets you control what the user can do while the report is active. - Toolbar
Lets you associate a custom toolbar with the report that's visible when the user is previewing the report. - Shortcut Menu Bar
Determines what shortcut menu is associated with the report while the report is being previewed. The shortcut menu bar appears when the user clicks the right mouse button over the Preview window. - Fast Laser Printing
Determines whether lines and rectangles are replaced with text character lines when you print a report with a laser printer. If fast printing is your objective and you're using a laser printer, you should set this property to Yes. - Help File, Help Context ID
The Help File and Help Context ID properties let you associate a help file and help topic with the report. - Tag
The Tag property is an extra property for storing information defined by the user at either design time or runtime. It is Microsoft Access's way of giving you an extra property. Access makes no use of this property; if you don't take advantage of it, it will never be used. - Has Module
Determines whether the report contains an associated class module. If no code will be included in the report, eliminating the class module can both improve performance and reduce the size of the application database. A report without a class module is considered a "lightweight object," which loads and displays faster than an object with an associated class module.
CAUTIONA couple of the Has Module property's behaviors deserve special attention. When a report is created, the default value for the Has Module property is No. Access automatically sets the Has Module property to Yes as soon as you try to view a report's module. If you set the Has Module property of an existing report to No, Access asks you if you want to proceed. If you confirm the change, Access deletes the object's class module and all the code it contains!