/>
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.
zd-defaultauthor-susan-harkins.jpg
By Susan Harkins on
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

Apricorn Aegis Secure Key 3NXC
Apricorn Aegis Secure Key 3NXC

Related Galleries

Apricorn Aegis Secure Key 3NXC

12 Photos
ioSafe Duo: Fireproof and water resistant data storage (in pictures)
ioSafe Duo

Related Galleries

ioSafe Duo: Fireproof and water resistant data storage (in pictures)

12 Photos
When chatbots are a very bad idea
When Chatbots are a very bad idea ZDNet

Related Galleries

When chatbots are a very bad idea

6 Photos
Hybrid transactional analytical processing
htap1.png

Related Galleries

Hybrid transactional analytical processing

3 Photos
Insight Platforms as a Service
ipaas1.png

Related Galleries

Insight Platforms as a Service

3 Photos
Streaming becomes mainstream
streaming1.png

Related Galleries

Streaming becomes mainstream

3 Photos
The machine learning feedback loop
ml1.png

Related Galleries

The machine learning feedback loop

5 Photos