Beginning Access 2007 VBA

As part of the testing process, you should fine-tune the application to make it run faster and better. You can apply various techniques to improve the real speed, as well as the speed as perceived by users.

Improving Actual Performance

The speed at which your application actually performs can be improved by applying some general design guidelines, coding techniques, and data access techniques. You will now look at each of these in turn.

General Design Guidelines

Here are several general guidelines to help improve the actual performance of your applications:

Let’s now look at some ways you can improve performance by writing better VBA code.

Optimizing VBA Code

You have various ways to accomplish the same task using VBA code, some of which are faster than others. Here are some examples:

Improving Data Access

The performance of Access applications can be degraded because of improper data access. To make your applications run faster, keep the following guidelines in mind:

Improving Perceived Performance

The prior sections focused on how to improve the actual performance of your application. In this section, you look at a few ways to improve the performance as perceived by the end users. In other words, you are not really speeding up the application by implementing these features, but you make the user feel like the application is running faster or that progress is being made.

Running the Performance Analyzer

Access comes with a Performance Analyzer utility that will analyze the selected objects and make suggestions to help improve the speed. You must have the database you wish to analyze open in order to run the analyzer.

Try It Out-Using the Performance Analyzer

Let’s walk through an example of using the Performance Analyzer to analyze all the objects in the Northwind database for suggested ways to improve speed.

  1. Select Database Tools and then click on Analyze Performance in the Analyze ribbon. A screen similar to the one shown in Figure 12-8 is displayed.

    Figure 12-8

  2. Select the All Object Types tab, as shown in Figure 12-8. Click the Select All button and then select OK. This selects all the objects in the database to analyze. The analyzer runs, and a screen similar to the one shown in Figure 12-9 is displayed, which makes various suggestions on ways to improve the performance of the application.

    Figure 12-9

How It Works

The Performance Analyzer is a wizard you can use to let Access provide some suggestions on how to improve the performance of the application. In the example, you ran the wizard against the Northwind database and discovered that some additional improvements can still be made to make the application run even faster.

Категории