Home

Introduction to Controls Design

Controls Design Fundamentals

Windows Controls

To populate a form or a report, you will use various objects called Windows controls or simply, controls. The controls are available in the Ribbon when the form is in Design View:

Controls

If you resize the Ribbon to a size that cannot show all controls, to show the hidden objects, you can click a down-pointing arrow:

Controls

Controls

Controls

In our lessons, we will mostly use controls listed in the Controls section of the Ribbon. If they are not enough, to access more controls, you can click the ActiveX Controls button. This would bring the Insert ActiveX Control dialog box from where you can select a control:

Insert ActiveX Control

After selecting the desired control, you can click OK.

The Windows controls are represented with small icons in the Controls section. Each item is identified with a name. Here is an example for an option group:

Controls

For the rest of our lessons, each control will be referred to by the name that displays from the tool tip.

Practical Learning: Identifying the Controls

  1. Start Microsoft Access
  2. From the list of files in the left column, click Road System1 (from Lesson 4)
  3. On the Ribbon, click Create
  4. In the Form section, click Form Design
  5. On the Ribbon, position the mouse (do not click) on each object in the Controls section and see the name of the control

Adding Controls to a Form or a Report

To select a control, click it in the Controls section of the Ribbon. Then, on the form or report, click an area of your choice. To add the same control many times to a form or report, in the Controls section of the Ribbon, right-click the control and click Drop Multiple controls. On the form or report, click where you want to (temporarily) position the control. To dismiss the multiple choice, in the Design tab of the Ribbon, click the Select button.

Practical Learning: Adding Controls From the Ribbon

  1. In the Controls section of the Ribbon, click the Text Box Text Box and move the mouse to the form

    Form Design

  2. Click somewhere in the middle-center area of the form (don't make any attempt to be precise)
  3. In the Controls section of the Ribbon, click the Button Button
  4. Click somewhere on the form.
    If a dialog box displays (it is supposed to), click Cancel
  5. In the Controls section of the Ribbon, right-click the Toggle Button Toggle Control and click Drop Multiple controls (to indicate that you will add it many times)
  6. Click somewhere in the top-left section of the form (again, no need for precision)
  7. Click again in the top-right section of the form
  8. Click the bottom-left section of the form
  9. On the Ribbon, click the Select button Select
  10. On the Ribbon, click File and click Open
  11. In the list of files, click StatesStatistics1 from the previous lesson
  12. When asked whether you want to save the form, click No
  13. In the Navigation Pane, right-click the States form and click Design View
  14. In the Controls section of the Design tab of the Ribbon, click Label Label
  15. Click somewhere on the form (no need for precision) and type State
  16. Right-click the tab of the form and click Save

Using Rulers and Dimensions

To assist you with design, a form or a report in Design View is equipped with two rulers, one horizontal in the top section and one vertical in the left section. To remove or hide the controls:

  • On the Ribbon, click Arrange. In the Sizing & Ordering section, click the Size/Space button and click Ruler:

A Form in Design View Without the Rulers

  • Right-click the middle of the form or report and click Ruler

Because you can ignore the rulers during design, you should leave them on.

Control Design and the Grid Lines

To assist you with setting the characteristics of a control, a form or a report in Design View is equipped with grid lines on its body:

Grid Lines

Introduction to Data Fields Design Techniques

Introduction to the Fields List

While designing a form or report unrelated to a table, if you decide that it must display data from a table, you can use a special window named Field List. To display the Field List, while the form or report is in Design View, on the Ribbon, click Design. In the Tools section, click the Add Existing Fields button: Field List. When the Field List is displaying, that button is highlighted: Field List.

If you create an independent form or report that doesn't get values from a table, the Field List is empty:

Field List

To specify the table that holds that data. This done using the arrow of the Record Source combo box to select a table. Here is an example:

Record Source

The Field List and the Property Sheet use the same window. This means that when one is displaying, the other is hidden.

Practical Learning: Accessing the Fields List

  1. The States form of the StatesStatistics1 database should still be displaying in Design View.
    Double-click the button at the intersection of the rulers of the form Intersection of Rulers.
    In the Property Sheet, click Data
  2. Click Record Source
  3. Click the arrow of the field and select States
  4. To save the changes, press Ctrl + S
  5. On the Ribbon, click File and click Open
  6. In the list of files, click Road System1
  7. On the Ribbon, click Create
  8. In the Form section, click Form Design
  9. Double-click the button at the intersection of the rulers of the form Intersection of Rulers.
    In the Property Sheet, click Data
  10. Click Record Source
  11. Click the arrow of the field and select Roads
  12. On the Ribbon, in the Tools section, click the Add Existing Fields button Field List

Adding a Field to a Form or a Report

When designing a form or a report, one of the most usual actions you will perform consists of adding items from the Field List to the form or the report.

To add a field to a form or a report, the Design View:

  • Click and drag the field from the Field list and drop it on the form or report
  • Double-click the item from the Field List and it would be added to the form or report

Practical Learning: Adding a Field from the Field List

  1. In the Field List, click RoadType and hold your mouse down
  2. Then drag RoadType from the Field List to somewhere in the body of the form (no need for precision)

    Adding a Field

  3. Release the mouse to drop
  4. In the Field List, click and drag RoadName to the form
  5. Drop it somewhere in the top section of the form above RoadType
  6. In the Field List, click and drag Distance to the form
  7. Drop it somewhere in the bottom section of the form.
    Here is an example of the result (but don't change your form to look like this) 

    Adding a Field

  8. To save the form, click the Save button on the left side of the title bar of Microsoft Access
  9. Set the form name to Roads
  10. Click OK
  11. On the Ribbon, click File
  12. In the list of files, click Cruise1 (otherwise, open the Cruise1 database from the previous lessons)
  13. On the Ribbon, click Create
  14. In the Form section, click Form Design
  15. Double-click the button at the intersection of the rulers Intersection of Rulers.
    In the Property Sheet, click Data
  16. Click Record Source
  17. Click the arrow of the field and select Employees
  18. On the Ribbon, in the Tools section, click the Add Existing Fields button Field List

Adding Many Fields to a Form or a Report

To add many fields to a form or a report, first select them:

  • To select adjacent fields, click a field from one end. Press and hold Shift. Then click a field at the other end of the group. Release Shift
  • To select fields at random, first click one. Press and hold Ctrl. Then click each of the fields, and release Ctrl
  • To select all fields, click the first (or the last) field. Press and hold Shift. Then click the last (or the first) field. Release Shift

Then drag the selection to the form or report.

Practical Learning: Inserting Fields

  1. In the Field List, click Nationality and hold your mouse down
  2. Then drag it (Nationality) from the Field List to the form (no need to be precise)

    Adding a Field

  3. Release the mouse to drop
  4. In the Field List, click LastName
  5. Press and hold Shift
  6. Then click FirstName
  7. Release Shift. This allows you to select a range of fields
  8. Click and hold the mouse on the selection
  9. Then drag it to the top section of the form (no need for precision)

    Adding Fields

  10. Release the mouse to drop
  11. To select fields at random, in the Field List, click MaritalStatus
  12. Press and hold Ctrl
  13. Click EmployeeNumber
  14. Click DepartmentCode
  15. Release Ctrl
  16. Click and hold the mouse on one of the selected items
  17. Drag to the lower section of the form (precision not required)

    Adding Fields

  18. Release the mouse to drop

    Adding Fields

  19. On the Ribbon, click File
  20. In the list of files, click StatesStatistics1 used earlier
  21. When asked whether you want to save the changes, click No
  22. In the Navigation Pane, right-click the States form and click Design View
  23. Click the body of the form to select the Detail section
  24. On the Ribbon, click Format
  25. In the Font section, click the down-pointing arrow of the Background Color button and select White, Background 1 (Theme Colors: 1st column, 1st row)
  26. On the Ribbon, click the Design tab
  27. In the Tools section, click Add Existing Fields
  28. In the Field List, if necessary, click Abbreviation
  29. Press and hold Shift
  30. Click Capital
  31. Release Shift
  32. Drag the selection to the form (no need for precision) away from any existing control and release the mouse to drop
  33. Close the form
  34. When asked whether you want to save, click Yes

Control Selection

Selecting One Control

After adding a control to a form or report in Design View, to manipulate it, you can first select the control. To select a control:

Control Selection

The Properties of a Selected Control

A control that is selected displays 8 handles around its body with the top-left handle thicker than the others:

The Handles of a Button

When a control is selected on the form or report, the Property Sheet shows only its characteristics and you can change only the characteristics of the selected control.

Selecting Various Controls

To select more than one control, at random, click one, then press and hold Shift. While holding Shift, click each of the desired controls. After selecting the controls, release Shift.

To select controls aligned vertically, click inside of the horizontal ruler above the highest positioned control. Everything that would be touched by the fake line will be selected:

Selecting Horizontally Aligned Controls

Selecting Horizontally Aligned Controls

In the same way, you can select controls that are horizontally aligned by clicking inside the vertical ruler. To select many controls in the same area on the form, click next to one of them and draw a fake rectangle that covers each of the desired controls:

Drawing a Rectangle to Select Controls

All controls touched by the fake rectangle would be selected when you release the mouse

Drawing a Rectangle to Select Controls

To select all controls on the form or report, you can press Ctrl + A. You can also click inside of one of the rulers on one end:

Selecting Horizontally Aligned Controls

And drag to the other end. After selecting the controls, you can change the common properties of the selected controls.

Selecting Horizontally Aligned Controls

To remove a control from the selected controls, press and hold Shift, then click the undesired control. You can include an object back by pressing Shift and clicking the control.

To dismiss the selected controls, simply click an unoccupied area of the form or report.

When many controls are selected, the Property Sheet shows (only) the characteristics common to those controls. This means that you can change the common characteristic(s) that many controls share and each would receive the change.

Practical Learning: Ending the lesson


Previous Copyright © 2007-2021, FunctionX, Inc. Next