The properties that apply to the entire form, to the five sections of the form, and to each control object on the form are determined by the values shown in the Properties window. To view the Properties window for a control, select the control by clicking anywhere on its surface; then click the Properties button on the toolbar. Alternatively, right-click the control and choose Properties from the pop-up menu. The following list describes how to select and display the properties of form sections and control objects:
Changing the Size of the Form Header and Form FooterYou can change the height of a form section by dragging the Form Header, Page Header, Detail, Page Footer, or Form Footer bar vertically with the mouse. When you position the mouse pointer at the top edge of a section divider bar, it turns into a line with two vertical arrows. You drag the pointer with the mouse to adjust the size of the section above the mouse pointer. The height of the Detail section is determined by the vertical dimension of the window in which the form is displayed, less the combined heights of all the header and footer sections that are fixed in position. When you adjust the vertical scroll bar, only the Detail section scrolls. Selecting, Moving, and Sizing a Single ControlWhen you select a control object by clicking its surface, the object is enclosed by a shadow line with an anchor rectangle at its upper-left corner and seven smaller, rectangular sizing handles (see Figure 14.18). Figure 14.18. The appearance of selection or sizing handles and the mouse pointer depend on the moving or sizing operation in progress.
Note Most controls have attached labels. When you select one of these objects, the label and object are selected as a unit. Selecting and deselecting controls is a toggling process. Toggling means repeating an action with the effect of alternating between On and Off conditions. The Properties, Field List, and Toolbox buttons on the toolbar as well as their corresponding menu choices are toggles. The Properties window, for example, appears and disappears if you repeatedly click the Properties button. The following choices are available for moving or changing the size of a control object (the numbers correspond to the numbers in Figure 14.18):
Aligning Controls to the GridThe Form Design window includes a grid that consists of one-pixel dots with a default spacing of 24 to the inch horizontally and 24 to the inch vertically. When the grid is visible, you can use the grid dots to assist in maintaining the horizontal and vertical alignment of rows and columns of controls. Even if the grid isn't visible, you can cause controls to "snap to the grid" by choosing Format, Snap to Grid. This menu command is a toggle, and when Snap to Grid is active, the menu choice is checked. Whenever you move a control while Snap to Grid is active, the upper-left corner of the object jumps to the closest grid dot. You can cause the size of control objects to conform to grid spacing by choosing Format, Size, To Grid. You also can make the size of the control fit its content by choosing Format, Size, To Fit. Tip If Snap to Grid is on and you want to locate or size a control without reference to the grid, press and hold the Ctrl key while you move or resize the control. Toggling the View, Grid menu command controls the visibility of the grid; by default, the grid is visible for all new forms. If the grid spacing is set to more than 24 per inch or 10 per centimeter, the dots aren't visible. For "non-metrified" users, better values are 10 per inch for Grid X and 12 per inch for Grid Y. This grid dot spacing is optimum for text controls that use the default 8-point MS Sans Serif font. To change the grid spacing for a form, follow these steps:
Selecting and Moving Multiple ControlsYou can select and move several objects at a time by using one of the following methods:
If you select or deselect a control with an associated label, the label is selected or deselected along with the control. You can change some property values such as font size and foreground or background color of all multiply-selected controls. Note The selection rectangle selects a control if any part of the control is included within the rectangle. This behavior is unlike many drawing applications in which the entire object must be enclosed to be selected. You can change the behavior of Access's selection rectangle to require full enclosure of the object by choosing Tools, Options; selecting the Forms/Reports tab (refer to Figure 14.11); and changing the value of the Selection Behavior option from Partially Enclosed to Fully Enclosed. Aligning a Group of ControlsYou can align selected individual controls, or groups of controls, to the grid or each other by choosing Format, Align and completing the following actions:
Your forms have a more professional appearance if you take the time to align groups of controls vertically and horizontally. Tip To quickly select a group of controls in a column or row, click within the horizontal or vertical ruler. This shortcut selects all controls intersected by the vertical or horizontal projection of the arrow that appears when you move the mouse within the ruler. Using the Windows Clipboard and Deleting ControlsAll conventional Windows Clipboard commands apply to control objects. You can cut or copy a selected control or group of controls to the Clipboard. After that, you can paste the control or group to the form using Edit menu commands and then relocate the pasted control or group as desired. Access uses the Windows keyboard shortcut keys: Ctrl+X to cut, Ctrl+C to copy selected controls to the Clipboard, and Ctrl+V to paste the Clipboard contents. The traditional Shift+Delete, Ctrl+Insert, and Shift+Insert commands perform the same operations. You can delete a control by selecting it and then pressing Delete. If you accidentally delete a label associated with a control and Edit, Undo doesn't solve the problem, do the following: select another label, copy it to the Clipboard, select the control the label needs to be associated with, and paste the label to the control. Changing the Color and Border Style of a ControlAs mentioned earlier in this chapter, the default color for the text and borders of controls is black. Borders are one pixel wide (called hairline width). Some objects, such as text boxes, have default borders. Labels have a gray background color by default, but a better choice for the default label color would have been transparent. Transparent means that the background color of the object under the control (the form section, in this case) appears within the control except in areas of the control that are occupied by text or pictures. You control the color and border widths of a control from the Line/Border Color and Line/Border Width buttons on the Formatting toolbar. You must select a border style directly in the Properties window. To change the color or border width of a selected control or group of controls, follow these steps:
Note The general practice for Windows data-entry forms is to indicate editable elements with borders and clear backgrounds. Still, some popular software uses reverse video as the default to indicate editable text. You can create the effect of reverse video by choosing black or another dark color for the fill of a text box control and a light color for its text. If you decide to implement reverse text, remember that reverse text is more difficult to read than normal text, so consider using a larger font and adding the bold attribute to ensure legibility. To set the border style, you must select the Border Style property directly in the Properties window, as explained earlier in this chapter. Changing the Content of Text ControlsYou can edit the content of text controls by using conventional Windows text-editing techniques. When you place the mouse pointer within the confines of a text control and click the mouse button, the mouse pointer becomes the Windows text-editing cursor that you use to insert or delete text. You can select text by dragging the mouse over it or by holding down Shift and moving the cursor with the arrow keys. All Windows Clipboard operations are applicable to text within controls. Keyboard text selection and editing techniques using the arrow keys in combination with Shift are available, also. If you change the name of a field in a text box and make an error naming the field, you receive a "#Name?" error message in the offending text box when you select Run mode. Following is a better method of changing a text box with an associated label:
You can relocate and resize the new field caption and text box (or edit the caption) as necessary. Using the Format PainterThe Format Painter lets you quickly copy the format of any control on the form to any other control on the form. The Format Painter copies only those formatting properties that are relevant to the control on which you apply the Format Painter. To use the Format Painter, follow these steps:
Typically, you use the Format Painter to quickly set the formatting properties for field text labels, or in any situation where selecting several controls by dragging a selection rectangle seems undesirable. By locking the Format Painter, it's easy to format several controls one after another. |