P rj f rj ing See Chapter for information on creating Word documents of various types filled with SMfiHiSi Access data

FIGURE 1.9

A report with formatted text.

W rptSelectedLetter

p

Your Company

Street Address City, State, Zip

Sunday, October 22, 2006

Holly Harvey 8282 Warren St. Bldg. 939

Mt. Ashley, GA 11111-1111

IMPORTANT PROJECT NOTES

Please keep one copy and return one signed copy frith signed contract

i

In order to ensure an efficient, neat and quality abatement, we ask that vou review the following:

Please be sure that the work area and access to the wort area is cleared of all movable objects.

Please make certain that there is adequate parking for our vehicles, as close as possible to the entrance to the work area. Driveways and outside access ways leading to the work area must be accessible and free of personal items and obstructions. Additionally; in winter, they must be free of snow and ice.

Please be. certain that you are at the project site when our technicians arrive. If you cannot be there-arrangements must be made with our office in advance to ensure access, in order that we may complete your project in a timely manner, without any additional charges to you.

50% of the total project cost should have been submitted along with the signed contract. The balance is due and should be ready at the conclusion of the project. If you will not be present at all times while the work is in progress, it is very important that you leave a telephone number with our office, where you can be reached. Please call our office between 12:30 and 2:00, so that we can update you on the status of the project, and give you, if possible, an estimated time, of completion. This way you can take a "walk-through" of the finished project and then make the final payment. Additionally our workday can run as late as 7:00pm —9:00pm. Therefore you should not make any special plans that cannot be altered, so that you can review the project when complete d.

Please turn off the heat upon rising on the morning of the project (pipes, boilers, or hot nater heaters).

Using a Naming Convention

■ first realized what a problem it is to work in a database with no naming convention when I took over a database created by another programmer. The database had a table, a query, a form, a report, a function, and five or six variables (of different data types) all called Sales (this was only one of a number of sets of objects with the same name). This meant that when I encountered the word "Sales" in VBA code, I had no idea whether it was a reference to a table, form, query, function, or variable, unless the context made it clear. There were numerous errors because of the use of the same name for different types of objects, because (among other possible sources of errors) you can set the value of a field with a variable, or with a function — and if several variables and a function are all called Sales, the code may use the wrong one.

You can also get circular reference errors when a control has the same name as the field to which it is bound —which is still the case in Access 2007, when you create a form bound to a table using the Form Wizard. To prevent these reference errors, it is an excellent idea to use a naming convention for database objects, controls, and variables. Using a naming convention also makes your database self-documenting (to some extent, at least), and prevents confusion when selecting an object from a drop-down list.

About 10 years ago, I wrote an Access 97 add-in (LNC Rename.mda) to automate the process of giving the appropriate tags to database objects and controls on forms and reports, using the Leszynski Naming Convention (LNC). This add-in was updated for Access 2000, and that version still works in Access 2007; it is available as Code Sample #10 (for Access 2000 or higher databases) from the Code Samples page of my web site, www.helenfeddema.com.

Creating Worksheet-type Reports in Access

If you need to produce a report formatted in familiar worksheet-type rows and columns, you can do this with an Access report. Access 2007 reports have some new features, letting you sort and filter interactively — and if you want full interactivity, you can create a PivotTable or PivotChart form. To demonstrate these features, I used a variation of the Northwind sample database, with objects renamed according to the Leszynski Naming Convention.

Was this article helpful?

0 0

Post a comment