Whether you're discussing databases, dogs, or dirigibles, looks count. In the case of databases, attractive design is not merely a matter of making your reports and forms look pretty. A more aesthetically pleasing form or report often means greater efficiency and enhanced functionality.
Here are a few Access features to convey information more effectively or improve the appearance of your database objects. (The formatting toolbar is shown in Figure 12.13.)
Figure 12.13. The tools of the Formatting toolbar.
1 Object Selector
3 Font Size
7 Align Left
9 Align Right
10 Fill/Back Color
11 Font/Fore Color
12 Line/Border Color
13 Line/Border Width
14 Special Effects
Usually there's little reason to change the default Arial 10-point font in tables. Although you can bold, underline, or italicize datasheet text, it usually serves little purpose. These fonts do not make your data easier to view. Conditional formatting can occasionally be helpful, as discussed in the next section.
If you do want to experiment with different fonts, avoid serif fonts (such as Times New Roman) for onscreen viewing. (A serif is a fine line projecting from the main stroke of a letter, such as that at the bottom of the letter t.) Instead, stick with nonserif fonts such as Arial.
You can use conditional formatting in forms and reports to highlight specific numbers that meet conditions. You can apply a variety of special formatting, including bold, italics, and color.
Figure 12.14 shows the Conditional Formatting dialog box with the first drop-down list open to display three choices: Field Has Focus, Field Value Is, and Expression Is.
Figure 12.14. In the Conditional Formatting dialog box, use the Field Value Is setting to apply conditions in the same field.
If you want to set a condition in the same field, use Field Value Is. For example, say you want values in the ShipCost field to be red whenever they're over $10. Follow these steps:
You use the Expression Is choice when you want the formatting to change in one field when a condition is true in another field of the same record. For example, suppose you want the shipping date to be highlighted whenever the shipping cost is over $10. Here are the steps:
Here are two other points worth noting:
Special effects usually work better onscreen than on paperin other words, they have greater relevance for forms than reports. On paper, the layout of the material should be adequate to distinguish one type of information from another.
Figure 12.15 shows the various special effects available from the Special Effects palette on the Formatting toolbar in forms and reports. You apply them by selecting the control and clicking the effect. Here are some tips for working with them:
Figure 12.15. Special effects are occasionally useful for highlighting controls and improving appearance.
Can Grow, Can Shrink
Let's say you have a field that contains state abbreviations, such as AZ and CA. You know you'll need just two characters for all of the field's values, so you set the Field Size property for the State field in the table at 2. When you create a form, that field size is inherited by the text box for the field. Therefore, you know exactly how much space the text box will take up on your form.
That's not the case for a field with a Memo data type whose contents are, say, the histories of countries. Then the amount of required space could vary radically from record to record. It's likely you'll want to enter many more words for China than for Chad.
In a form, you can have a scroll bar so that users can view the hidden text. But what do you do in a report? Because reports are usually printed, a scroll bar is no solution. If you need six times as much space for Italy as for Moravia, how can you make the report adapt to the changing space requirements?
The solution is the Can Grow and Can Shrink properties. When you set these properties to Yes in a report, the text box grows or shrinks to reflect the various space requirements.
What happens to the controls surrounding the Can Grow or Can Shrink text box? When a text box grows or shrinks, the entire report section grows or shrinks vertically. Adjacent controls move either up or down.
Also, note that a text box can't shrink to a height that's less than that of other controls on the same row. Let's say you have a text box with an accompanying label; the Can Shrink property in the text box is set to Yes. If there's no value in the text box, the label still appears, as does the text box, which cannot be shorter than the label.
As you can tell, this is definitely an area in which you'll want to switch frequently from Design view to Print Preview to see the impact of possible changes. Furthermore, try using test data of varying lengths to see how the controls adjust to various space requirements.
Reduce Empty Space
When you create a report, you'll sometimes find that it has a lot of empty space. Here are some things you can do to eliminate it:
A line has both functional and decorative purposes. You can use a line to indicate areas with similar information (such as a line that separates a form from a subform). You can also use a line with some color or style to add visual interest.
The Line tool available in the toolbox is not difficult to use. I'll just make a few points that perhaps are not immediately apparent:
Finally, you don't need to draw lines to separate different sections of a form. By default, the Dividing Lines property on the Format tab of the Form property sheet is set to Yes.
A rectangle, available from the toolbox, is one way to highlight or segregate a group of controls with similar data. Rectangles are not difficult to create, and I think you can make your way around the toolbar to find the Fill/Back Color, Line Border/Color, Line/Border Width, and Special Effects buttons that control their appearance (refer to Figure 12.13).