Using the Toolbox to Insert Native Controls

3 4

Adding new controls to forms will probably be a frequent task. You might need to display the results of an expression (in a calculated control), or you might need to expand your form’s functionality as your application grows. (You probably won’t add controls to reports quite as often.) The Toolbox offers quick access to native controls. (The term native controls refers to the controls that come with Access.) The Toolbox is actually a toolbar that you can toggle on and off by clicking the Toolbox button on the appropriate design toolbar (Form Design, Report Design, or Page Design). In Page Design view, the Toolbox offers more controls than in other design views.

Follow these steps to insert a native control on a form. (You can use the same steps to insert a control on a report or a data access page.)

  1. Open a form in Design view by clicking Forms on the Database window’s Objects bar and then double-clicking Create Form In Design View. (Alternatively, you can click the New button in the Database window.)
  2. If necessary, display the Toolbox by clicking the Toolbox button on the Form Design toolbar or by choosing View, Toolbox.
  3. Deselect the Control Wizards tool in the Toolbox to avoid launching a control wizard.
  4. Click any control tool in the Toolbox, and then move the mouse pointer toward the form. When the mouse pointer enters the form window, Access will display the crosshair mouse pointer and a small icon that represents the selected control, as shown in Figure 8-1.

    figure 8-1.the mouse pointer represents the type of control you clicked in the toolbox.

    Figure 8-1. The mouse pointer represents the type of control you clicked in the Toolbox.

  5. Click anywhere inside the form (except on another control) to insert a control of the same type that you clicked in the Toolbox.

note


The exception to this rule is the label control. When you insert a label control, you do click the form, but Access displays an insertion point, not a blank control. Enter the text you want to display in the label, and Access will adjust the width of the control accordingly. If you click but don’t enter anything, Access won’t insert a label control. As soon as you click something else, the insertion point disappears.

Using Non-Native Controls

Click the More Controls button in the Toolbox to display a long list of available controls that aren’t native to Access. Most of these controls are Microsoft ActiveX controls and are installed by other software. As long as you have a legitimate license for the hosting software, you might be able to use these controls in your Access applications, but this ability can’t be taken for granted, because some applications do limit use of controls to only the host software. You should also refer to the host software’s licensing information before you distribute a non-native control in an Access application.

If you have the Developer Edition of Microsoft Office XP (often called MOD), you have a set of extra ActiveX controls that will work when used on Access forms. Although these controls don’t appear in the Toolbox, they can be located in the More Controls list—scan for controls whose names start with Microsoft and end with version 6.0, such as the Microsoft Common Dialog Control, version 6.0.

To insert several controls of the same type at one time, follow these steps:

  1. First make sure the Control Wizards tool is deselected. Then double-click the control tool that represents the control you’re about to insert. (Double-clicking locks the tool to your mouse pointer.)
  2. Click inside the form to add a control. Click inside the form a second time to add a second control.
  3. Continue clicking inside the form until you insert enough controls. When you’ve finished, unlock the current tool by clicking the Select Objects tool.

Positioning the Toolbox

As mentioned, the Toolbox is actually a toolbar, which means you can move it around or dock it (attach it to a border). When you first install Access, the Toolbox opens as a floating (undocked) toolbar. Busy or large forms can be a challenge to work with in Design view, and you might want to move the Toolbox to accommodate your form. You can do so simply by clicking the Toolbox’s title bar and then dragging the Toolbox to another location. The Toolbox doesn’t have a default position, so closing the Toolbox has no effect on its position or state. Access simply remembers where the Toolbox was the last time it was open and returns it to that location. If the floating Toolbox is in the way, you can move it or dock it in one of two ways:

  • Double-click the Toolbox’s title bar to return it to its last docked position.
  • Drag the Toolbox to any of the four screen borders, and then release it.

To undock the Toolbox, drag the handle—the small raised rectangle at the left end of the docked Toolbox (see Figure 8-2)—away from the docked position, and then release the handle.

figure 8-2. drag the toolbox by its handle to any border, and then release it to dock it.

Figure 8-2. Drag the Toolbox by its handle to any border, and then release it to dock it.

tip - Resize the Toolbox


You might find yourself in a tight spot someday—not wanting to dock the Toolbox but unable to arrange it in an out-of-the-way spot. If this happens, you can adjust the size and shape of the Toolbox when it is undocked. Simply position the mouse pointer over any border or corner until Access displays the bidirectional mouse pointer. Use this mouse pointer to adjust the borders as necessary to change the size and shape of the Toolbox.



Microsoft Access Version 2002 Inside Out
Microsoft Access Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612838
EAN: 2147483647
Year: 2005
Pages: 172
Authors: Helen Feddema

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net