• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Working with Forms > Adding Controls

Adding Controls

When you create a form with a wizard, Access automatically creates controls where you can enter and peruse the data in your tables. Using the Toolbox feature, you can go beyond that basic level of functionality and add other controls, such as labels to describe different areas of your form, text boxes to accept user input, or images to make your form more appealing and easier to use. You can also add list boxes, combo boxes, and command buttons, to make it easier to enter data, run queries related to the data in the underlying tables, print the form, and perform a host of other tasks.

To add a control:

1.
Click the Toolbox button on the toolbar ( Figure 4.20 ).

Figure 4.20. Clicking the Toolbox button displays the controls you can add to a form or report.


2.
In the Toolbox, click the icon representing the control you want to add.

Your mouse pointer changes to a miniature of the icon you chose.

3.
Move your pointer to the spot on the form where you want your control to appear and click the left mouse button.

4.
A wizard will appear for every control type except labels, text boxes, lines, and rectangles. All you need to do is follow the wizard's instructions to give your control life.

Tip

You can create labels, text boxes, lines, and rectangles using just the mouse. For instance, to draw a line, click the line icon in the Toolbox, click the starting point for the line on your form, and drag the mouse to the line's endpoint.


Tip

If you want to turn off a control's wizard, click the Control Wizards button on the Toolbox. When the wizards are turned off the button will appear "flat" against the background, rather than recessed.


Tip

If you didn't quite get your control's size right when you created it, you can resize it by clicking the control and grabbing one of the six black boxes that will appear on its border. Just drag the box until the outline on the form is the right size.


Types of Controls in Access

List boxes and combo boxes are two very useful controls to add to your forms and reports. Other common controls include:

  • Labels contain text you type in when you create a form or report. They're good for identifying different sections of a form or for giving users instructions when they fill out the form.

  • Text boxes give users a place to enter comments.

  • Option buttons, toggle buttons, and check boxes let users answer yes/no and on/off questions with a single click of the mouse.

  • Option groups are sets of option buttons (or toggle buttons or check boxes) that allow a user to pick only one option from the group.

  • Command buttons you can use to run a macro, Visual Basic code module, or other Windows program.

  • Image and object frames allow you to include pictures and other OLE- compliant objects in your forms and reports.

  • Tab controls let you put information on pages accessed by clicking a tab at the top of the control. The Properties dialog box is a tab control.

  • Page breaks help you to format your forms and make them more readable.

  • Subforms and subreports let you show the "many" side of a one-to-many relationship based on the contents of the parent form. (You'll learn more about subforms and subreports later in this chapter.)

  • Lines and boxes are graphical elements you can use to make your forms and reports easier to use and look at.


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint