Understanding the Access Toolbox

graphics/toolbox.gif The Access Toolbox is based on the Toolbox that Microsoft first created for Visual Basic. Essentially, the Access Toolbox is a variety of toolbar. You select one of the 20 buttons that appear in the Toolbox to add a native control represented by that tool's symbol to the form. Selecting a tool lets you select a control, enable or disable the Control Wizards, or add a Microsoft or third-party ActiveX control to the form. When you create a report, the Toolbox serves the same purpose although tools that require user input, such as combo boxes, seldom are used in reports.

Control Categories

Three control object categories apply to Access forms and reports:

  • Bound controls are associated with a field in the data source for the form or subform. Binding a control means connecting the control to a data source, such as a field of a table or a column of a query, which supplies the current value to or accepts an updated value from a control. Bound controls display and update values of the data cell in the associated field of the currently selected record. Text boxes are the most common bound control. You can display the content of graphic objects or play audio files embedded in a table with a bound OLE object. You can bind toggle buttons and check boxes to Yes/No fields. Option button groups bind to fields with numeric values. All bound controls have associated labels that display the Caption property of the field; you can edit or delete these labels without affecting the bound control.

  • Unbound controls display data you provide that is independent of the form's or subform's data source. You use the image or unbound OLE object control to add a drawing or bitmapped image to a form. You can use lines and rectangles to divide a form into logical groups or simulate boxes used on the paper form. Unbound text boxes are used to enter data that isn't intended to update a field in the data source but is intended for other purposes, such as establishing a value used in an expression. Some unbound controls, such as unbound text boxes, include labels; others, such as unbound OLE objects, don't have labels. Labels also are unbound controls.

  • Calculated controls use expressions as their source of data. Usually, the data source expression includes the value of a field, but you also can use values created by unbound text boxes in calculated control expressions.

The Access Toolbox

graphics/toolbox.gif The Toolbox appears only in Design view for forms and reports, and it appears only if you click the Toolbox button on the toolbar or toggle the View, Toolbox menu choice. When the Toolbox is visible, the Toolbox menu choice is checked; Figure 15.1 shows the Toolbox in its default mode a two-column floating toolbar. You can select one of the 17 controls and three other buttons, whose names and functions are listed in Table 15.1.

Figure 15.1. The Access Toolbox lets you add 17 different native controls to forms and reports.

graphics/15fig01.gif

Table 15.1. Names and Functions of Access Toolbox Buttons

Tool

Name

Function

graphics/select_object.gif

Select Objects

Changes mouse pointer to the Object Selection tool. Deselects a previously selected tool and returns the mouse pointer to normal selection function. Select Objects is the default tool when you open the Toolbox.

graphics/run.gif

Control Wizards

Turns the Control Wizards on and off. Control Wizards aid you in designing complex controls, such as option groups, list boxes, and combo boxes.

graphics/label.gif

Label

Creates a box that contains fixed descriptive or instructional text.

graphics/text_box.gif

Text Box

Creates a box to display and allow editing of a data value and also creates a corresponding label, which you can choose to delete.

graphics/option_group.gif

Option Group

Creates a frame of adjustable size in which you can place toggle buttons, option buttons, or check boxes. Only one of the objects within an object group frame can be selected. When you select an object within an option group, the previously selected object is deselected.

graphics/toggle.gif

Toggle Button

Creates a button that changes from On to Off when clicked. The On state corresponds to Yes ( 1), and the Off state corresponds to No (0). When used within an option group, toggling one button On toggles a previously selected button Off. You can use toggle buttons to let the user select one value from a set of values.

graphics/option.gif

Option Button

Creates a round button (originally called a radio button) that changes from the Off to On state when you select it. Option buttons are most commonly used within option groups to select between values in a set in which the choices are mutually exclusive.

graphics/check_box.gif

Check Box

Creates a check box that toggles On and Off. Multiple check boxes should be used outside option groups so that you can select more than one check box at a time.

graphics/combo_box.gif

Combo Box

Creates a combo box with an editable text box where you can enter a value, as well as a list from which you can select a value from a set of choices.

graphics/table_option.gif

List Box

Creates a drop-down list box you can select a value from. A list box is the list portion of a combo box.

graphics/command_box.gif

Command Button

Creates a command button that, when clicked, triggers an event that can execute an Access VBA event-handling procedure.

graphics/image.gif

Image

Displays a static graphic on a form or report. This is not an OLE image, so you can't edit it after placing it on the form.

graphics/unbound_object_frame.gif

Unbound Object Frame

Adds an OLE object created by an OLE server application, such as Microsoft Chart or Paint, to a form or report.

graphics/bound_object_frame.gif

Bound Object Frame

Displays the content of an OLE field of a record if the field contains a graphic object. If the field contains no graphic object, the icon that represents the object appears, such as the Sound Recorder's icon for a linked or embedded .wav file.

graphics/page_break.gif

Page Break

Causes the printer to start a new page at the location of the page break on the form or report. Page breaks don't appear in form or report Run mode.

graphics/tab_control.gif

Tab Control

Inserts a tab control to create tabbed forms. (The tab control looks like the tabbed pages you've seen in the Properties windows and dialogs throughout this book.) Pages of a tab control can contain other bound or unbound controls, including subform/subreport controls.

graphics/sub_form.gif

Subform/Subreport

Adds a subform or subreport to a main form or report, respectively. The subform or subreport object you intend to add must exist before you use this control.

graphics/line.gif

Line

Creates a straight line that you can size and relocate. You can change the color and width of the line by using the Formatting toolbar buttons or the Properties window.

graphics/rectangle.gif

Rectangle

Creates a rectangle that you can size and relocate. The border color, width, and fill color of the rectangle are determined by selections from the palette.

graphics/more_control.gif

More Controls

Clicking this tool opens a scrolling list of ActiveX controls that you can use in your forms and reports. The ActiveX controls available through the More Controls list aren't part of Access; ActiveX controls are supplied as .ocx or .dll files with Office 2003, Visual Basic, and various third-party tool libraries.

Using controls in the design of reports is discussed in Chapter 16, "Working with Simple Reports and Mailing Labels" and Chapter 17, "Preparing Advanced Reports." Using command buttons to execute VBA code is covered in Part VII of this book, "Programming and Converting Access Applications."



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

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