Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 19: Advanced Access Form Techniques


695


The Header/Footer group includes other commands for adding a logo (virtually any image file) and
a title to the form header area. Using the Header/Footer controls in an application gives all the
forms a consistent appearance (see Figure 19.7, which is frmDialog in the sample database).

FIGURE 19.7

The header control provides a consistent look to your Access forms.


Using the Image control
A subtle and often overlooked performance issue in Access applications occurs when static images
are added to forms. Images are often added to Access forms as OLE objects, which means that a
certain amount of memory and disk space is required to maintain the image’s connection to its
parent application. This overhead is used even when the image is a company logo or other graphic
that will not be changed or edited at runtime.

Access simplifies this process and provides a great deal more flexibility with the Image control. The
Image control places an image frame onto a form or report, but does not burden the image object
with the overhead associated with OLE objects. The Image control accepts virtually any type of
image data type recognized by Windows (.bmp, .pcx, .ico, .dib, .gif, .wmf, .jpg, .png,
.tif and so on), and enables you to specify the path to the image file at runtime in its Picture
property. The Image control also accepts image data stored in an Access table, although it doesn’t
provide the flexibility of in-place editing.

Morphing a control
Surely one of the most frustrating problems when building Access forms is the need to specify the
control type as a control is added to a form. For example, consider the issues involved when you
add a list box to an Access form, specify the ControlSource, RowSourceType, RowSource,
and other properties and then discover there’s not enough room on the form for the list box. In
this case, it seems the only solution is to remove the list box, add a combo box, and reset all the
properties, even though the properties for the combo box are identical for the list box you just
removed.
Free download pdf