X

Reduce repetitive formatting for Access objects

If you find yourself constantly making formatting adjustments to Access objects on the fly, you're bogging yourself down unnecessarily. A couple of tricks can save you tons of time: Either change control defaults for a particular form or report or customize a form or report and turn it into a template.
By Susan Harkins, Contributor
65133.jpg
1 of 7 Susan Harkins/ZDNET
This gallery is also available as an article and a PDF download.

Objects come with a set of built-in properties that determine how they look and behave. As you create new forms, reports, and controls, you can adjust an object's default properties as required. But often, you'll find that objects require the same changes. For instance, you may want to use a font other than the default throughout your database. Changing the font for every new control on every form and report is inefficient. There are two ways to reduce your work when the default formats Access offers aren't adequate:


  • Change control defaults for the current form or report.
  • Use a custom form or report as a template.
65129.jpg
2 of 7 Susan Harkins/ZDNET

If a control's default formats aren't adequate, you can change the default. There's a trick to the process, and it's not easy to discern. But it's easy to implement once you know how. Let's apply this trick to change a control's default background color:

  1. Open a blank form in Design view.
  2. Insert a text box control. Most likely the default background color is white, but it doesn't matter.
  3. To change the default background for subsequent text box controls, click the Text Box control in the Toolbox, but don't click inside the form.
  4. Click the Properties button. Notice that the resulting window's title bar identifies the current control as the Default Text Box.
  5. In the Properties sheet, change the Back Color property to any color other than the current color. (Click the Builder button to display an easy-to-use palette.) At this point, you can change as many properties as necessary.

65142.jpg
3 of 7 Susan Harkins/ZDNET

  1. Click inside the form to insert a new text box control. This control's background color isn't the same as the first, as you can see here, but you expected that.

65143.jpg
4 of 7 Susan Harkins/ZDNET
  1. Insert a third text box control. Its background color is the same as the second control's. The form remembers the change you made before inserting the second control.


If you change a control's property before inserting it, you change the default property for that particular control type for that form (or report). Keep in mind the following when temporarily changing default properties:


  • The default is valid for only the specified control type. Changing a text box control's default property won’t affect a list box or a label control -- only the text box control will apply the temporary default.
  • The default remains in effect until you change it by repeating the process or closing the form or report without saving the new default.
  • The change affects only the current form or report.
  • You can change multiple properties for a single control type at the same time.

If the form or report already has a control with all the appropriate settings, select the control and choose Set Control Defaults from the Format menu. Doing so has the same affect as the above process.

If you want to use a custom control in other forms, use the copy and paste method to copy the formatted control from one form to another. In the new form, with the formatted control selected, choose Set Control Defaults from the Format menu to update the control defaults for that form.
65132.jpg
5 of 7 Susan Harkins/ZDNET
For the sake of consistency, formats usually apply to objects throughout a database. Although you can copy custom formats from one form to another, doing so is inefficient. To apply custom formats database-wide, create templates. To create a simple form template, complete the following steps:


  1. Open a new form in Design view.
  2. Change the Detail section's Back Color property.
  3. Insert a text box control and change its Border Color to a color that contrasts with the Detail section's new background.
  4. Set the control's Border Width to 5 point (so you can easily see the difference).
  5. Select the text box and choose Set Control Defaults from the Format menu to set the default properties shown here for subsequent text box controls.
65127.jpg
6 of 7 Susan Harkins/ZDNET

  1. Save the form, naming it Template. (You must name the form accordingly for this technique to work.)

65128.jpg
7 of 7 Susan Harkins/ZDNET
Using the template couldn't be simpler. When you're ready to create a new form, click the Forms shortcut in the Database window and then click New on the Database toolbar or double-click the Create Form In Design View shortcut, just as you normally would. The new form's custom background color and default text box control will match those in Template.

You can create a report template the same way. All subsequent forms (and reports) will begin with Template. At any time, you can update the form defaults by redesigning Template. Creating a template will not change existing forms.

To reset the database's template option back to Normal, choose Options from the Tools menu and click the Forms/Reports tab. Enter Normal in the Form Template field, as shown here. Doing so won't destroy the Template form object, but it will reset the template form the database uses for new forms.

Related Galleries

Holiday wallpaper for your phone: Christmas, Hanukkah, New Year's, and winter scenes
Holiday lights in Central Park background

Related Galleries

Holiday wallpaper for your phone: Christmas, Hanukkah, New Year's, and winter scenes

21 Photos
Winter backgrounds for your next virtual meeting
Wooden lodge in pine forest with heavy snow reflection on Lake O'hara at Yoho national park

Related Galleries

Winter backgrounds for your next virtual meeting

21 Photos
Holiday backgrounds for Zoom: Christmas cheer, New Year's Eve, Hanukkah and winter scenes
3D Rendering Christmas interior

Related Galleries

Holiday backgrounds for Zoom: Christmas cheer, New Year's Eve, Hanukkah and winter scenes

21 Photos
Hyundai Ioniq 5 and Kia EV6: Electric vehicle extravaganza
img-8825

Related Galleries

Hyundai Ioniq 5 and Kia EV6: Electric vehicle extravaganza

26 Photos
A weekend with Google's Chrome OS Flex
img-9792-2

Related Galleries

A weekend with Google's Chrome OS Flex

22 Photos
Cybersecurity flaws, customer experiences, smartphone losses, and more: ZDNet's research roundup
shutterstock-1024665187.jpg

Related Galleries

Cybersecurity flaws, customer experiences, smartphone losses, and more: ZDNet's research roundup

8 Photos
Inside a fake $20 '16TB external M.2 SSD'
Full of promises!

Related Galleries

Inside a fake $20 '16TB external M.2 SSD'

8 Photos