Logo
HOW TO
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows 7

Microsoft Access 2010 : Report Properties and Why to Use Them, Basing Reports on Stored Queries or Embedded SQL Statements

1/23/2015 8:43:46 PM

You can modify many different properties on reportsto change how the report looks and performs. Like form properties,report properties are divided into categories: Format, Data, Event, andOther. To view a report’s properties, you first select the report,rather than a section of the report, in one of two ways:

After you have selected a report, you can view and modify its properties.

Working with the Properties Window

To select a report and open the Properties window atthe same time, you double-click the report selector. When you select areport, the Properties window appears, showing all the propertiesassociated with the report. A report has 77 properties available on theProperty Sheet (there are additional properties available only fromcode), broken down into the appropriate categories in the Propertieswindow. Fifty of the properties relate to the report’s Format, Data,and the properties on the Other tab; the remaining 27 relate to theevents that occur when a report is run. The Format, Data, and Otherproperties are described here.

The Format Properties of a Report

Areport has the following 29 Format properties for changing the report’sphysical appearance. The text that follows explains many of the Formatproperties:

The Report’s Data Properties

A report has the following six Data properties, which are used to supply information about the data underlying a report:

Other Properties of a Report

A report has 15 Other properties (see Figure 2 );these miscellaneous properties, some of which are described in thefollowing text, enable you to control other important aspects of areport:

Figure 2. The Other properties of a report.


A 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 whether you wantto proceed. If you confirm the change, Access deletes the object’sclass module and all the code it contains.


Basing Reports on Stored Queries or Embedded SQL Statements

Basing Access reports on stored queries offers two major benefits:

  • The query underlying the report can be used by other forms and reports.

  • Sophisticated calculations need to be built only once—they don’t need to be re-created for each report (or form).

In earlier version of Access, reports based on stored queries open faster than reports based on embedded SQL statements. This is because when you build and save a query, Access compiles and creates a query plan. This query plan is a plan of execution that’s based on the amount of data in the query’s tables as well as all the indexes available in each table. In early versions of Access, if you ran a report based on an embedded SQL statement, the query was compiled, and the query plan was built at runtime, slowing the query’s execution. With Access 2010, query plans are built for embedded SQL statements when a form or report is saved. Query plans are stored with the associated form or report.

So what are the benefits of basing a report on a stored query instead of an embedded SQL statement? You may want to build several reports and forms, all based on the same information. An embedded SQL statement can’t be shared by multiple database objects. At the very least, you must copy the embedded SQL statement for each form and report you build. Basing reports and forms on stored queries eliminates this problem. You build the query once and then modify it if changes need to be made to it. Many forms and reports can all use the same query (including its criteria, expressions, and so on).

It’s easy to save an embedded SQL statement as a query, and doing so allows you to use the Report Wizard to build a report using several tables. You can then save the resulting SQL statement as a query. With the report open in Design view, you bring up the Properties window. After you select the Data tab, click in the Record Source property and click the ellipsis (...). The embedded SQL statement appears as a query. You need to select Save Object As from the File tab, enter a name for the query, and click OK. Then you close the Query window, indicating that you want to update the Record Source property. The query is then based on a stored query instead of an embedded SQL statement.


Reports often contain complex expressions. If a particular expression is used in only one report, nothing is lost by building the expression into an embedded SQL statement. On the other hand, many complex expressions are used in multiple reports and forms. If you build these expressions into queries on which the reports and forms are based, you have to create each expression only one time.

Although basing reports on stored queries offers several benefits, it also has downsides. For example, if a database contains numerous reports, the database container becomes cluttered with a large number of queries that underlie those reports. Furthermore, queries and the expressions within them are often very specific to a particular report. If that is the case, you should opt to use embedded SQL statements rather than stored queries. As a general rule, if several reports are based on the same data and the same complex calculations, you should base them on a stored query. If a report is based on a unique query with a unique set of data and unique calculations, you should base it on an embedded SQL statement.


Other -----------------
- Microsoft Access 2010 : Working with Sorting and Grouping (part 2) - Sorting and Grouping Settings
- Microsoft Access 2010 : Working with Sorting and Grouping (part 1) - Add Sorting and Grouping to a Report
- Microsoft Access 2010 : Building Reports Based on More Than One Table (part 3) - Working with Subreports
- Microsoft Access 2010 : Building Reports Based on More Than One Table (part 2) - Build a One-to-Many Report by Using the Report Wizard
- Microsoft Access 2010 : Building Reports Based on More Than One Table (part 1) - Build a One-to-Many Report by Using the Report Wizard
- Microsoft Access 2010 : Building Powerful Reports - Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Building Powerful Reports - Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Building Powerful Reports - The Anatomy of a Report
- Microsoft Visio 2013 : Adding Sophistication to Your Drawings - Grouping shapes
- Microsoft Visio 2013 : Adding Sophistication to Your Drawings - Inserting fields: the basics
 
 
REVIEW
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
 
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro