Home

Characteristics of a Form

Anatomy of a Form

The Form's Tab

As mentioned for a table, a form can display with a tab or a title bar. In the Form View or in Design View, a form's top section displays an icon Form Icon.

Practical Learning: Introducing Forms Properties

  1. Start Microsoft Access
  2. From the list of files, click Cruise1 (from the previous lesson)
  3. On the Ribbon, click Create
  4. To create and design a new form, in the Forms section, click Form Design
  5. To save the new form, right-click its tab and click Save
  6. Set the name to CruiseShips
  7. Press Enter

Tabbed Documents or Overlapped Windows?

When a form displays with a tab, the right section of the tab(s) has a close button Close that you can use to close the form. To replace the tab of a form, click File and click Options. In the left frame of the Access Options dialog box, click Current Database. Click the Overlapping Windows radio button:

Overlapped Windows

After making the selection, click OK. You will be asked to close and reopen the database:

Message Box

The Title Bar

The middle section of the title bar is actually referred to as the title bar. It can be used to change the view of the form after right-clicking it.

The Caption of a Form

The caption of a form is text that displays on the title bar or the tab of the form. By default, the caption of a form is its name. To specify or change the caption of a form, access its Property Sheet and, in the Format or the All tab, click Caption and type the desired string.

Practical Learning: Specifying the Caption of a Form

  1. The Cruise1 database should still be opened.
    In the Navigation Pane, double-click the CruiseShips form to open it in Form View

    The Caption of a Form

  2. To switch it back to Design View, right-click the body of the form and click Design View
  3. Double-click the button in the top-left section under the tab  Intersection of Rulers
  4. In the Property Sheet of the form, click the Format tab and click Caption
  5. Type Cruise Connections - Passenger Ships

    Propery Sheet - Caption

  6. To see the title of the form, right-click the form tab and click Form View

    The Caption of a Form

  7. To save the form, press Ctrl + S
  8. On the Ribbon, click Home.
    In the Views section, click the arrow under the View button and click Design View
  9. On the Ribbon, click File
  10. From the list of files, click Ceil Inn1 from Lesson 5
  11. On the Ribbon, click Create
  12. To start a new form, in the Forms section, click Form Design
  13. In the Property Sheet, click Caption and type Ceil Inn - Occupancies

The Control Box

If you display a form as overlapped, it would be equipped with three system buttons Minimize, Maximize or RestoreClose. The group of these buttons is called the Control Box. If you do not want these system buttons at all, access the Property Sheet of the form and set the Control Box Boolean property to No from its Yes default value.

The System Menu

A form has a system menu on its top-left icon. To display this menu, the user can click the form's system icon:

System Menu

The presence of the form's system icon is partly controlled by the Control Box property of a form.

The Form's Borders

The borders of a form specify where a form starts and where it ends. If a database is configured to show overlapped windows, the borders of a form are controlled using the Border Style property. If you set it to None, the form would appear without borders.

The Sections of a Form

The Detail Section

The Detail section serves as the main host of other controls. There are two main ways you can change the Detail section's height at design time:

  • In the Format tab of the Property Sheet, change the value of the Height field
  • Click and drag the lower border of the Detail section:

    Height

The Form Header and the Form Footer

A form can be equipped with a Form Header and a Form Footer sections. To add these sections, right-click the middle of the form and click Form Header/Footer:

The Form Header and the Form Footer

Form Header and Footer

Although two sections are added, you can reduce one completely so it would not appear to the user. This means that you can keep one section and hide the other. If you create a form using the Form Wizard, both the header and the footer sections are added but the footer section is completely reduced so it would not appear to the user. If you want to display it to the user, you must expand it.

Practical Learning: Creating the Sections of a Form

  1. While the form is still displaying in Design View, right-click the body of the form and click the Form Header/Footer
  2. Right-click the title bar of the form and click Save
  3. Set the form name to Occupancies and click OK
  4. On the Ribbon, click File
  5. In the list of files, click Cruise1 (otherwise open the Cruise1 database used in the beginning of this lesson)
  6. In the Navigation Pane, right-click the CruiseShips form and click Design View
  7. Right-click the body of the form and click the Form Header/Footer
  8. To remove the header and footer sections, right-click the form and click the Form Header/Footer

The Page Header and the Page Footer

A form can also be equipped with two Page Header and Page Footer sections. To get them, right-click the middle of the form and click Page Header/Footer.

Dividing Lines

A form is equipped with dividing horizontal lines used to visually separate sections of a form. To equip a form with dividing lines, add a header and a footer sections. The presence or absence of the horizontal lines is controlled by the Boolean Dividing Lines property.

The Size of a Form

The Width of a Form

The width of a form is the distance from its left border to its right border. All sections use the same width. To widen or narrow a form, click and drag the right border:

The Width of a Form

The width of a form is controlled by the Width field in the Properties Sheet.

Practical Learning: Changing the Width of a Form

  1. The CruiseShips form should be displaying in Design View.
    Click the button at the intersection of the rulers Intersection of Rulers
  2. In the Property Sheet,  click the Format tab
  3. Click Width
  4. Type 11 and press Enter

The Height of a Form

The height of a form is controlled by its sections. Each section has a Height field in the Property Sheet.

Practical Learning: Changing the Height of a Form

  1. On the form, click the Detail bar
  2. In the Format tab of the Property Sheet, click Height
  3. Type 5.85
  4. On the Ribbon, click File
  5. In the list of files, click Ceil Inn1 used earlier in this lesson
  6. When asked whether you want to save the changes, click Yes
  7. In the Navigation Pane, right-click the Occupancies form and click Design View

The Width and Height of a Form

To change both the width and the height of a form at the same time, position the mouse on the lower-right corner:

Resizing a Form

Then click and drag left, right, up, down, or diagonally.

Automatically Sizing the Form to Fit Its Content

As mentioned already, when a form displays in Form View, if its content is wider or taller than the current size can show, the form would be equipped with scroll bars. If you (in fact the user) want to resize the form enough to show its whole content, on the Ribbon, click Home. In the Window section, click Size To Fit Form.

Automatically Centering a Form

When you open a form from the Navigation Pane, it is positioned from the top-left corner of Microsoft Access. If you want the form to be automatically centered, access its Property Sheet and, in the Format or the All tab, set its Auto Center Boolean property to Yes from its default No value.

Colors on Forms and Reports

The Background Color of a Section

To support background colors, when you select an object such as a form or a report, the Ribbon provides a button labeled Shape Fill. Use it to set a color to the object.

To support the background color, the forms and the reports have a property named Back Color in the Property Sheet. The field is equipped with two buttons. The down-pointing arrow allows you to select a common or known color:

Back Color

The Browse button allows you to select or create a color. As another technique, you can provide the value of a color as a hexadecimal number. For example, the red color is #FF0000, the blue color is #0000FF, and so on.

To change the background color of a section of a form or a report:

  • On the Ribbon, click Home and, in the Text Formatting section, select a color from the Background Color button Fill/Back Color
  • Right-click a section, position the mouse on Fill/Back Color and click the desired color

Fill/Back Color

  • On the Ribbon, click Format. In the Control Formatting section, click the Shape Fill button Fill/Back Color
  • Access the Property Sheet of the section. In the Format or the All tab, click the Back Color field

Practical Learning: Setting Background Color

  1. The Occupancies form should still be displaying in Design View.
    Click the Form Header bar to select its section
  2. On the Ribbon, click Home
  3. In the Text Formatting section, click the arrow of the Background Color button and select Blue, Accent 1, Darker 50% (Theme Colors: 5th column - 6th row)
  4. On the form, right-click under the Detail bar, position the mouse on Fill/Back Color and click Light Blue 1 (5th column - 2nd row)
  5. On the form, double-click the section under the Form Footer bar
  6. In the Property Sheet, click the Format bar and click Back Color
  7. Click the browse button and click select Blue, Accent 5, Darker 50% (Theme Colors: 9th column - 6th row)
  8. On the Ribbon, click File and click Open
  9. From the list of files, click StatesStatistics1 from Lesson 2
  10. When asked whether you want to save, click Yes
  11. On the Ribbon, click Create
  12. In the Forms section, click Form Design
  13. Double-click the body of the form to access the properties of the Detail section
  14. In the Property Sheet, click Format
  15. Click Back Color, then click its browse button and select Blue, Accent 5, Darker 50% (Theme Colors: 9th column, 6th row)
  16. Right-click the tab of the form and click Save
  17. Set the name of the form to States and press Enter
  18. On the Ribbon, click File
  19. In the list of files, click Cruise1
 
 
 

The Background Picture of a Form

Introduction

You can cover a form with a picture. To use a picture as a background, open the form in Design View, access the Property Sheet for the form. In the Format or the All tab, click Picture and click its browse button. Here is an example:

Background Picture

This would produce:

Background Picture

Practical Learning: Setting the Background of a Form

  1. The Cruise1 database should still be opened with the CruiseShips form in Design View.
    Click the button at the intersection of the rulers on the form
  2. In the Proeprty Sheet, click Format and click Picture
  3. Click its Browse button
  4. From the resources that accompany these lessons, locate the CruiseShip.png picture
  5. Click OK

    Background Picture

  6. To preview the form, right-click its tab and click Form View
  7. After viewing the form, right-click its tab and click Design View
  8. To save the form, press Ctrl + S

Linking or Embedding the Picture

Picture embedding or linking is controlled by the Picture Type enumerated property whose two values are Embedded (the default) and Linked:

  • If you set the Picture Type to Linked, the file name of the picture (with its extension) would be set as the value of the Picture property
  • If you set the Picture Type to Embedded, you would be asked to first remove the value of the Picture property. You must specify the picture again. This time, the (whole) path of the file name would be set as the value of the Picture property

The Picture Alignment

The position of the background picture is controlled by the Picture Alignment property whose default value is Center. Its other values are: Top Left, Top Right, Center and Form Center, Bottom Left, and Bottom Right.

Practical Learning: Aligning the Background

  1. In the Format tab of the Property Sheet, click Picture Alignment. Then click the arrow of its combo box and select Top Left
  2. To preview the form, right-click its tab and click Form View:

    Picture Alignment

  3. After viewing the form, right-click its tab and click Design View
  4. To save the form, click the Save button in the top-left section of Microsoft Access

Tiling the Picture

To use a picture smaller than the form but have it repeat itself on the form, in the Format or the All tab of the Property Sheet, set the Picture Tiling Boolean property to Yes. Consider the following example:

Background Picture

Picture Background

If you set the Picture Tiling property to Yes, this would produce:

Picture Background

Practical Learning: Tiling the Background Picture

  1. In the Format tab of the Property Sheet, double-click Picture Tiling to set its value to Yes
  2. Close the form
  3. When asked whether you want to save, click Yes

Zooming or Stretching a Picture

Zooming or stretching is controlled by the Picture Size Mode property. Its values are Clip, Stretch, Stretch Horizontal, Stretch Vertical, and Zoom.

Practical Learning: Ending the Lesson

  • Close Microsoft Access
 
 
   
 

Previous Copyright © 2002-2016, FunctionX, Inc. Next