Setting Section and Report Properties


You’ve probably noticed that Access 2007 has a property sheet for each section in the Report window in Design view. You can set section properties not only to control how the section looks but also to control whether Access should attempt to keep a group together or start a new page before or after the group. There’s also a property sheet for the report as a whole. You don’t need to change any of these properties at this point, but the following sections explain the available property settings.

Section Properties

When you click in the blank area of any group section or Detail section of a report and then click the Property Sheet button in the Tools group on the Design tab, Access displays a property sheet, such as the one shown in Figure 16–6.

image from book
Figure 16–6: This is a property sheet for a report section.

The available properties and their uses are described in Table 16–2.

Table 16–2: Properties for a Section
Open table as spreadsheet

Property

Description

Name

Access automatically generates a unique section name for you.

Visible

Set this property to Yes to make the section visible or to No to make the section invisible. You can set this property from a macro or from a Visual Basic procedure while Access formats and prints your report. You can make sections disappear depending on data values in the report.

Height

This property defines the height of the section. You normally change this property by dragging the bottom edge of the section. If you want a specific height, you can enter it here, and Access changes the display to match as long as all controls fit within the defined height. If you attempt to set the height smaller than will accommodate the controls in the section, Access sets the height to the minimum that can contain the controls.

Back Color

The default back color of a section is the color value for white, #FFFFFF. You can also choose a custom color by clicking in the property and then clicking the Build () button to open the color picker. Click More Colors to open the Colors dialog box. You can also choose colors by clicking the Fill/Back Color button in the Font group on the Design tab.

Alternate Back Color

The default alternate back color of a section is No Color. With this setting Access applies the defined back color to all rows of data in that section. If you use the Report Wizard to create your report, Access might set an alternating back color in the Detail section of your report depending upon which style you choose. If you want to display a different back color on alternating rows of data in a section, click the Build () button to open the color picker. Click More Colors to open the Colors dialog box. You can also choose alternating colors by clicking the Alternate Fill/Back Color button in the Font group on the Design tab. When you define an Alternate Back Color, Access applies the Back Color to the first, third, and so on rows, and it applies the Alternate Back Color to the second, fourth, and so on, rows. This property is not available in page headers and footers.

Special Effect

The default setting is a flat effect. You can also set a raised or sunken effect for a section using the Special Effect button in the Controls group on the Design tab or by clicking this effect from the drop-down list for the property.

Auto Height

The default setting, Yes, causes the section’s height to adjust automatically when you resize controls resized in Layout view. If you shrink the height of controls in Layout view, for example, Access shrinks the height of the section as well. If no controls exist in a section, Access reduces the section height to 0 inches. Change this property to No to not allow Access to automatically resize the section when controls are resized.

Can Grow

Setting this property to Yes allows the section to expand to accommodate controls that might expand because they display memo fields or long text strings. You can design a control to display only one line of text, but you should allow the control to expand to display more lines of text as needed. If you set the Can Grow property for any control in the section to Yes, Access automatically sets the Can Grow property of the section to Yes. This property is not available in page headers and footers.

Can Shrink

This property is similar to Can Grow. You can set it to Yes to allow the section to become smaller if controls in the section become smaller to enclose less text. Unlike Can Grow, setting the Can Shrink property for any control in the section to Yes does not automatically set Can Shrink for the section to Yes. The default setting is No. This property is not available in page headers and footers.

Display When

The default setting, Always, displays this section in Report view, Layout view, Print Preview, and when you print the report. Choose Print Only to display the section only when you view the report in Print Preview or you print the report. Choose Screen Only to display the section only when in Report view and Layout view.

Keep Together

Set this property to No to allow a section to flow across page boundaries. The default Yes setting tells Access to attempt to keep all lines within a section together on a page. (You can tell Access to attempt to keep detail lines together with group headers and footers by setting the Keep Together property in a Group, Sort, And Total specification to either Keep Whole Group Together On One Page or to Keep Header And First Record Together On One Page.) This property is not available in page headers and footers.

Force New Page

Set this property to Before Section to force the section to print at the top of a new page. Set this property to After Section to force the next section to print at the top of a new page. You can also set this property to Before & After to force the section to print on a page by itself. The default setting is None. This property is not available in page headers and footers.

New Row Or Col

When you use the Page Setup dialog box to format your report with more than one column (vertical) or more than one row (horizontal) of sections, you can set this property to Before Section, After Section, or Before & After to produce the section again at the top, bottom, or both top and bottom of a new column or row. This property is useful for forcing headers to print at the top of each column in a multiple-column report. The default setting is None. This property is not available in page headers and footers.

On Click

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when a user clicks inside this section in Report view. See Part 4, “Automating an Access Application,” for details.

On Format

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when it begins formatting this section. See Part 4 for details.

On Dbl Click

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when a user double-clicks inside this section in Report view. See Part 4 for details.

On Mouse Down

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when a user clicks the mouse button while the mouse pointer rests on this section in Report view. See Part 4 for details.

On Mouse Up

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when a user releases a mouse button while the mouse pointer rests on this section in Report view. See Part 4 for details.

On Mouse Move

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when a user rests their mouse pointer on this section in Report view. See Part 4 for details.

On Paint

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when this section is redrawn in Print Preview or Report view. See Part 4 for details.

On Print

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when it begins printing this section or when it displays the section in Print Preview. See Part 4 for details.

On Retreat

Enter the name of a macro or a Visual Basic procedure that you want Access to execute when it has to “back up” over a section after it finds that the section won’t fit on the current page and you’ve set the Keep Together property to Yes. This event happens after On Format but before On Print, so you can use it to undo settings you might have changed in your On Format routine. Access calls On Format again when it formats the section on a new page. See Part 4 for details. This property is not available in page headers and footers.

Tag

Use this property to store additional identifying information about the section. You can use this property in macros and in Visual Basic procedures to temporarily store information that you want to pass to another routine.

Report Properties

If you select the Report option from the Selection Type list in the Property Sheet window (or click in the Report window beyond the right edge of the Detail section and then click the Property Sheet button in the Tools group on the Design tab), Access displays the report’s properties in the property sheet, as shown in Figure 16–7.

image from book
Figure 16–7: The property sheet for a report displays many properties that you can customize for the report object.

Some of the available properties and their uses are described in Table 16–3.

Table 16–3: Properties for a Report
Open table as spreadsheet

Property

Description

Record Source

This property displays the name of the table or query that provides the data for your report. You can also enter a valid SQL statement for the record source.

Caption

Use this property to set the text that appears in the title bar when you open the report in Report view, Layout view, and Print Preview. If you don’t specify a caption, Access displays Report: and the name of the report in the window title bar if you are using multipledocument interface or on the report’s tab if you are using singledocument interface.

Pop Up

Set this property to Yes to make the report window in Report view and Print Preview open as a pop-up. A pop-up window stays visible on top of other windows even when another window has the focus. The default setting is No. If you’re using a single-document interface, Access does not display a tab for this report but instead shows the report as a pop-up window.

Modal

Set this property to Yes to disallow clicking any other window or clicking the Ribbon when the Report window is open in Report view or Print Preview. The default setting is No.

Display On SharePoint Site

Use this property to tell Access to create a view for this report if the database is migrated to a Microsoft Windows SharePoint Services (version 3) site. The default setting, Follow Table Setting, tells Access to honor the setting specified for the underlying table. Choose Do Not Display to not have Access create a view on the Windows SharePoint Services Version 3 site of this report.

Default View

Use this property to tell Access in which view to first open the report. The default setting, Report view, tells Access to open the report in Report view when you double-click the report in the Navigation Pane or click Open on the report’s shortcut menu. Select Print Preview to have Access open the report in Print Preview when opened from the Navigation Pane or from the Open command on the report’s shortcut menu. If you set the Default View property to Report View and set the Allow Report View property to No, Access removes the Report View option from the Views group and opens the report in Print Preview.

Allow Report View

The default setting, Yes, specifies that you can open this report in Report view and you can switch to Report view from other views. If you change the setting to No, Access removes Report View as an option in the Views group on the Ribbon.

Allow Layout View

The default setting, Yes, specifies that you can open this report in Layout view and you can switch to Layout view from other views. If you change the setting to No, Access removes Layout View as an option in the Views group on the Ribbon.

Picture, Picture Type

To use a bitmap as the background of a report, you enter the full path name and file name in the Picture property. If you set the Picture Type property to Embedded, Access copies the bitmap specified to the Report object. If you set the Picture Type property to Linked, Access uses the path name stored in the Picture property to load the bitmap each time you open the report. The default setting for Picture is (none), and the default setting for Picture Type is Embedded.

Picture Tiling

When you set the Picture Size Mode property to Clip or Zoom and your picture is smaller than the page size, you can set the Picture Tiling property to Yes so that Access will place multiple copies of the picture across and/or down the page. The default setting is No.

Picture Alignment

When you set the Picture Size Mode property to Clip or Zoom, you can use Picture Alignment to place the picture in the center of the page or in one of the corners. The default setting is Center.

Picture Size Mode

When your background picture is not the same size as your page, you can set the Picture Size Mode property so that Access adjusts the size. The Clip setting displays the picture in its original size, and if the page is smaller than the picture, Access clips the sides and top and bottom edges of the picture as necessary. The Zoom setting maintains the aspect ratio and shrinks or enlarges the picture to fit the page. If your picture doesn’t have the same horizontal-tovertical dimensions (aspect ratio) as your page, Access centers the image and shows some blank space at the sides or top and bottom of the page. The Stretch setting expands the picture to fit the page size and will distort the image if the aspect ratio of the picture does not match the aspect ratio of the page. The default setting is Clip.

Width

Access sets this property when you increase the width of the report in the design grid. If you want a specific width, you can enter it here, and Access changes the display to match as long as all controls fit within the defined width. If you attempt to set the width smaller than will accommodate the controls in any section, Access sets the width to the minimum that can contain the controls.

Auto Center

This setting affects the positioning of the Report window when you open the report in Report view or Print Preview using the multipledocument interface. This property has no effect when you are using the single-document interface unless you have also set the Pop Up or Modal property to Yes. The default setting, No, leaves the upper-left corner in the same location as when you last saved the Report window from Design view. When you specify Yes, the Report window opens centered in the Access workspace to the right of the Navigation Pane or opens centered in the Access window if you set either Pop Up or Modal to Yes. If you collapse the Navigation Pane after you open the report, Access moves the report to the left but does not center it again in the object workspace.

Auto Resize

This setting affects the size of the Report window when you open the report in Print Preview. The default setting, Yes, asks Access to zoom the report to show the first entire page and size the window to fit within the Access workspace on your screen when you’re using a multiple-document interface. When you’re using a single-document interface, the report opens in a window sized to approximately 80 percent of the height available in the Access workspace, with a width relative to the layout of the page (portrait or landscape) and the report sized to display the entire first page. Unless you have a very high-resolution monitor, most portrait layout reports will be unreadable with this setting. When you specify No, the report opens at 100 percent resolution. When you’re using a single-document interface, Access sizes the window the same as when you last saved the Report window from Design view or Layout view. We recommend you change this setting to No for most reports.

Fit To Page

Use this property to make Access expand the width of the report to fit a page while you are working in Layout view. The default setting, Yes, tells Access to automatically expand the width of the report to fit within the page margins. When you specify No, Access does not automatically expand the width and honors any width you specify for the report.

Border Style

The default setting, Sizable, allows you to resize the Report window in Report view or Print Preview when you use a multiple-document interface or you have set the Pop Up or Modal property to Yes. This property has no effect when you use a single-document interface and both Pop Up and Modal are set to No.

When you choose None, the report’s Report view and Print Preview windows have no borders, control menu, title bar, Close button, or Minimize and Maximize buttons. You cannot resize or move the report when it is open. You can select the report and press Ctrl+F4 to close it unless the report’s Pop Up property is set to Yes. You should write Visual Basic code to provide an alternative way to close this type of report.

When you choose Thin, the Report window in Report view or Print Preview has a thin border, signifying that the report cannot be resized.

When you choose Dialog and the Pop Up property is set to Yes, the border of the Report window in Report view or Print Preview is a thick line (like that of a true Windows dialog box), signifying that you can resize the report. If the Pop Up property is set to No, the Dialog setting is the same as the Thin setting.

Scroll Bars

Use this property to tell Access to display scroll bars for a report displayed in Report view or Layout view. The default setting, Both, causes Access to display both a horizontal and vertical scroll bar if needed to display the entire report. If you choose Neither, Access does not display either scroll bar, even if one is needed. You will not be able to scroll to see the rest of the report. Choose Horizontal Only to display only a horizontal scroll bar, or choose Vertical Only to display only a vertical scroll bar.

Control Box

You can set the Control Box property to No to remove the control menu and the Close, Minimize, and Maximize buttons from the Report window in Report view or Print Preview when you’re using a multiple-document interface. The default setting is Yes. You must use Ctrl+F4 to close the window when this property is set to No. This property has no effect when you’re using the single-document interface.

Close Button

You can set the Close Button property to No to remove the Close button from the Report window in Report view or Print Preview. When you’re using a multiple-document interface or you have set the Pop Up or Modal property to Yes, the control menu is still available unless you have also set the Control Box property to No, but the Close command is disabled on the menu. The default setting is Yes.

Min Max Buttons

You can set the Min Max Buttons property to Both Enabled, None, Min Enabled, or Max Enabled when you are using a multipledocument interface or you have set the Pop Up or Modal property to Yes. If you disable a Minimize or Maximize button, the related command on the control menu becomes dimmed when the Report window is in Report view or Print Preview. The default setting is Both Enabled.

Moveable

The default setting, Yes, allows you to move the Report window in Report view or Print Preview when you’re using a multipledocument interface or the Pop Up or Modal property is set to Yes. Set this property to No to lock the form on the screen where you last saved it.

Show Page Margins

The default setting, Yes, displays print margins for your report when you open it in Layout view. The print margins are determined by your printer settings. You can use this setting in Layout view to make sure no controls extend past the print margins. Set this property to No to not display print margins.

Grid X, Grid Y

Specify the number of horizontal (X) or vertical (Y) divisions per inch or per centimeter for the dots in the grid. When you use inches (when Measurement is set to U.S. in the Regional And Language Options section of Windows Control Panel), you can see the dots whenever you specify a value of 24 or less for both X) and Y. When you use centimeters (when Measurement is set to Metric), you can see the dots when you specify values of 9) or less. The default setting is 24 for inches and 10 for metric

Layout For Print

When you set this property to Yes, you can select from among the TrueType and printer fonts installed on your computer. When you set this property to No, only TrueType and screen fonts are available. The default setting is Yes.

Grp Keep Together

Set this property to Per Page if you want Access to honor the Group, Sort, And Total keep together setting by page. Set it to Per Column (the default) for a multiple-column report if you want Access to attempt to keep a group together within a column. This property has no effect in a typical report with a single column.

Picture Pages

You can set this property to show the picture on all pages, the first page, or no pages. The default setting is All Pages.

Page Header

This property controls whether the page header appears on all pages. You might choose not to print the page header on the first page if the report contains a report header. Valid settings are All Pages (the default), Not With Rpt Hdr, Not With Rpt Ftr, and Not With Rpt Hdr/Ftr.

Page Footer

This property controls whether the page footer appears on all pages. You might choose not to print the page footer on the last page if the report contains a report footer. Valid settings are All Pages (the default), Not With Rpt Hdr, Not With Rpt Ftr, and Not With Rpt Hdr/Ftr.

Orientation

The default in most versions of Access 2007 is Left-to-Right. In versions that support a language that is normally read right to left, the default is Right-to-Left. When you use Right-to-Left, captions appear right-justified, and the order of characters in controls is right to left.

Filter

This property shows any filter applied by a macro or Visual Basic procedure the last time the report was opened. You can also define a specific Filter setting that you want to save with the report definition. You can define a filter for a report, as you can with a form, using Ribbon commands when the report is in Report view. To activate the Filter in code, set the report’s FilterOn property (not displayed in the property sheet) to True.

Filter On Load

Set this property to Yes if you want Access to apply the filter defined for the report automatically each time the report opens. Note that you can set the Filter and FilterOn properties from a macro or a Visual Basic procedure. The default setting is No.

Order By

This property shows any ordering criteria applied by a macro or a Visual Basic procedure the last time the report was opened. You can also define a specific Order By setting that you want to save with the report definition. You can activate the ordering criteria in code by setting the OrderByOn property (not displayed in the property sheet) to True.

Order By On Load

Set this property to Yes if you want the Order By property defined for the report to be applied automatically each time the report opens. Note that you can set the OrderBy and OrderByOn properties from a macro or a Visual Basic procedure. Remember that Order By and Order By On Load have no effect if you have specified any settings in the Group, Sort, And Total pane. The default setting is No.

Allow Filters

Use this property to determine whether a user can see selected records in Report view by applying filtering and sorting criteria using the commands in the Sort & Filter group on the Home tab or by applying the shortcut menu filtering options. If you set the Allow Filters property to No, the user cannot change the report to view other existing records, and Access dims all commands in the Sort & Filter group. The valid settings for the Allow Filters property are Yes and No. The default setting is Yes.

On Current through On Page

You can set these properties to run a macro, a function, or an event procedure when the specific event described by the property occurs for this report. See Part 4 for details.

Date Grouping

Use this property to determine how Access groups date and time values that you’ve specified in the Group, Sort, And Total pane. You can set this property to US Defaults or Use System Settings (the default). For US Defaults, the first day of the week is Sunday, and the first week of the year starts on January 1. If you specify Use System Settings, the first day of the week and first week of the year are determined by the Regional And Language Options section in Windows Control Panel.

Cycle

Use the default setting, All Records, to tab to the next record when you press the Tab key in the last control in the tab order. This setting applies when you display the report in Layout view or Report view. Choose Current Record to disallow tabbing from one record to another. Choose Current Page to disallow tabbing onto the next or previous record-you must use Page Up or Page Down to move between the records. When you set Current Record or Current Page, you must use the navigation buttons or Ribbon commands to move to other records.

Record Locks

Set this property to All Records if the data for your report is on a network shared by others and you want to be sure that no one can update the records in the report until Access creates every page in the report. You should not set this property to All Records for a report that you plan to view in Layout view, Report view, or Print Preview because you’ll lock out other users for the entire time that you’re viewing the report on your screen. The default setting is No Locks.

Ribbon Name

Enter the name of a custom Ribbon. Access displays the Ribbon when you open the report in Report view or Print Preview. See Chapter 24, “The Finishing Touches,” for details.

Toolbar

Enter the name of a custom toolbar. Access displays the toolbar when you open the report in Report view or Print Preview. You can use this setting only if your database is in the .mdb file format and you defined custom toolbars in the database using a prior version of Access.

Menu Bar

Enter the name of a custom menu bar. Access displays the menu bar when you open the report in Report view or Print Preview. You can use this setting only if your database is in the .mdb file format and you defined custom menu bars in the database using a prior version of Access.

Shortcut Menu Bar

Enter the name of a custom shortcut menu. Access displays the shortcut menu when you open the report in Report view or Print Preview and right-click in the Report window. You must create custom shortcut menu bars by using Visual Basic code or by using the design facilities in a prior version of Access.

Help File, Help Context Id

You can set the Help File property to specify the location of a Help file in any format supported by Windows and the 2007 Microsoft Office system, including the HTML help format. Use the Help Context Id property to point to a specific help topic within the file.

Has Module

This property indicates whether the report has associated Visual Basic procedures. Access automatically changes this setting to Yes when you define any Visual Basic event procedures for the report. Caution: If you change this property to No when the report has procedures, Access warns you that this deletes your code.

Use Default Paper Size

The default setting, No, tells Access to not use the default paper size of your default printer when printing the report. Instead, Access honors the section size properties you defined. Change this setting to Yes to have Access use the default printer settings.

Fast Laser Printing

Some laser printers support the drawing of lines (such as the edges of rectangles, the line control, or the edges of text boxes) with rules. If you set the Fast Laser Printing property to Yes, Access sends rule commands instead of graphics to your printer to print rules. Rules print faster than graphics. The default setting is Yes.

Tag

Use this property to store additional identifying information about the report. You can use this property in macros and in Visual Basic procedures to temporarily store information that you want to pass to another routine.

Palette Source

With this property, if you have a color printer, you can specify a device-independent bitmap (.dib) file, a Microsoft Windows Palette (.pal) file, a Windows icon (.ico) file, or a Windows bitmap (.bmp) file to provide a palette of colors different from those in the Access default palette. You might need to set this property if you have also set the Picture property so that the colors of the background picture display properly. The default setting, (Default), uses your current Windows palette.

Key Preview

This property determines whether the report-level keyboard event procedures (KeyUp, KeyDown, and KeyPress) are invoked before a control’s keyboard event procedures. The default setting, No, tells Access that only the active control can receive keyboard events when the report is displayed in Layout view or Report view. Choose Yes to have the report receive keyboard events before the active control receives keyboard events when the report is displayed in Layout view or Report view.




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