Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

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

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server