Microsoft Access 2010 Bible

(Rick Simeone) #1

Part III: More-Advanced Access Techniques


736


The Amount text box will be dynamically formatted according to the value contained in the
CurrDecPlaces text box. This trick may be generalized to format fields other than currency
fields. By increasing the number of parameters of the user-defined formatting function, the format-
ting can be dependent on more than one field, if necessary.

Centering the title
Centering a report title directly in the middle of the page is often difficult. The easiest way to guar-
antee that the title is centered is to stretch the title from left margin to right margin, and then click
the Center Align button.

Easily aligning control labels
Keeping text boxes and their labels properly aligned on reports is sometimes difficult. Because a
text box and its label can be independently moved on the report, all too often the label’s position
must be adjusted to bring it into alignment with the text box.

You can eliminate text-box labels completely by including the label text as part of the text box’s
record source. Use the concatenation character to add the label text to the text box’s control source:

= “Product: “ & [ProductName]

Now, whenever you move the text box, both the label and the bound record source move as a unit.
The only drawback to this technique is that you must use the same format for the text box and its
label.

Micro-adjusting controls
The easiest way to adjust the size of text boxes on a form in tiny increments is to hold down the
Shift key and press the arrow key corresponding to Table 20.2.

TABLE 20.2

Micro-Adjustment Keystroke Combinations


Shift Combination Adjustment
Shift+Left Arrow Reduce width
Shift+Right Arrow Increase width
Shift+Up Arrow Reduce height
Shift+Down Arrow Increase height

Another resizing technique is to position the cursor over any of the sizing handles on a selected
control and double-click with the left mouse button. The control automatically “sizes to fit” the
text contained within the control. This quick method can also be used to align not only labels but
also text boxes to the grid.
Free download pdf