Experimenting with various form colors and fonts and trying all the AutoFormat styles is fun, but once you decide which background color, text font, and background style you prefer, it’s best to apply that style consistently to all the forms in the database. You don’t have to apply the formatting selections manually to each form—you can save your custom style as one of the AutoFormat choices so that you can quickly apply it to other forms.
A consistent color/font scheme gives an application a professional appearance, much like a Web page that uses a Microsoft FrontPage theme. You can use background color (both for forms themselves and for controls on forms) to give the user visual cues about how the form works. For example, you can use one background color for editable forms (or controls) and another color for read-only forms or controls.
Whenever you create a new form in Design view without using the Form wizard, the form is based on a form template. Unlike Word templates, which allow you to set up every aspect of a template’s appearance—and even much of its functionality, by using macros (Visual Basic for Applications [VBA] Sub procedures)—Access templates specify only a few basic form features, such as the background color of form sections and certaincontrol properties. Although Access templates can include VBA code, when you create a new form from the template, the form doesn’t inherit any of the code from the template’s code module.
Although you can’t preload an Access form template with a set of standard controls or include boilerplate code, you can specify the fonts, sizes, or other properties for controls on the new form. You have to import the form or report template into any database in which you want to use it. Because of these limitations, and because the AutoFormat feature now lets you apply one of a set of styles to a form, few Access users take the trouble to create a form template.
However, form templates do offer some advantages over customized AutoFormats. For example, you can specify different colors for the form header, footer, and detail sections. You can also specify properties for various types of controls by placing controls on the template form, setting them as desired, and then choosing Format, Set Control Defaults with the controls selected, as shown in Figure 5-35.
Figure 5-35. You can set control defaults for a form template.
If you do create an Access template and you want to use it when creating a new form in Design view, you must enter the template’s name on the Forms/Reports tab of the Options dialog box, as shown in Figure 5-36.
Figure 5-36. Enter your form template’s name on the Forms/Reports tab of the Options dialog box.
Now, when you create a new form in Design view, it will have the same header, footer, and detail background colors as the template, and the controls you place on the form will have the default values you set in the template—but only if the template form is available in the current database.
AutoFormat allows you to apply to your forms the preset format choices already created in Access. You can use AutoFormat styles as they are or you can modify and save them to use again on other projects. The AutoFormat feature is simpler to use than a form template, and it doesn’t require you to change any settings in the Options dialog box. Any custom styles you create are available in all your databases, without the need toimport any objects into new databases. However, AutoFormat styles don’t let you specify different colors for different form sections.
To create and save a custom AutoFormat style, follow these steps:
Figure 5-37. Select a built-in style to overwrite with a custom style.
Figure 5-38. Overwrite the built-in style with your custom style.
Now, when you apply your custom style to a form, that form will have the colors and control formatting settings you saved to that style. Figure 5-39 shows an example of an applied custom style.
Figure 5-39. The style saved from Form1 as the Industrial AutoFormat style has been applied to the Test form.
Using the Design Schemes Add-In
I originally created the Design Schemes add-in for Access 95, which had no AutoFormat utility. The form template feature in that version was the only option for applying a custom style to newly created forms and did not meet the needs of manyadvanced users. AutoFormat now offers you control over form section colors and control formats, but you must save your settings to the named style in the AutoFormat dialog box, and you still can’t populate new forms with controls or boilerplate event procedures.
Additionally, saved AutoFormats don’t allow you to create different types of forms useful for different situations, such as dialog forms, subforms, or forms with a record selector combo box in the header and a Close Form command button in the footer. The Design Schemes add-in allows users to select one of a set of predesigned forms with different sets of form properties. Users can also apply one of four standard (conservative) color schemes to the new form or create a custom color scheme (using the Design Schemes add-in’s full selection of control properties).
The Design Schemes add-in is described in detail in Chapter 15, "Using Add-Ins to Expand Access Functionality."