Forms & Reports:
Format Form

Title: Jan's Illustrated Computer Literacy 101
Did you want: Working with Databases: Access 2007, 2010, 2013, 2016


After you get your form set up with all the controls, it's time to consider more detailed formatting.

You will want to create a look and arrangement for your controls that makes it easy to read and to enter data.

An AutoFormat style can get you started, but you will probably want to make changes to it. You can save your changes as your own AutoFormat style and apply it to other forms.


Where you are:
JegsWorks > Lessons > Databases

Before you start...

Project 1: Intro

Project 2: Access Basics

Project 3: Tables & Queries

Project 4: Forms & Reports Arrow: subtopic open
    Import/Export/LinkTo subtopics
    Designing Forms Arrow: subtopic open
    Icon: StepForm Wizard
    Icon: StepControls
    Icon: StepCreate Form Manually
    Icon: StepFormat Form
    Icon: StepTab Control
    Icon: StepForm View
        Images in Forms & Reports
    Icon: StepForm Images
    Icon: StepRecord Images
    Icon: StepPrintable Form
    Designing ReportsTo subtopics
    Special Forms & ReportsTo subtopics
    Summary
    Quiz
    ExercisesTo subtopics


Search  
Glossary
  
Appendix



Icon: Step-by-Step 

Step-by-Step: Format Form

 Icon: Step-by-Step

What you will learn:

to apply an AutoFormat style
to change formatting
to adjust spacing
to add a rectangle
to save new formatting as an AutoFormat style
to apply custom AutoFormat style
to view Form Header/Footer
to copy controls from another form

Start with:  Class diskresource files, worldtravel.mdb from the previous lesson

AutoFormat

Now that you have all of your fields on the form, you can consider changing the AutoFormat style. Currently you are using the default style, Standard. An AutoFormat style can be applied just to selected controls or to the whole form at once.

WarningYou Cannot Undo AutoFormat: Choosing an AutoFormat style is not an action on the Undo list! Instead of being able to reverse your choice, you must select a different AutoFormat, such as the Standard style, or else manually re-format the controls that received the AutoFormat style. This can be a very sad situation if you lose a lot of formatting when you applied an AutoFormat style. Smiley: Sad

  1. Dialog: AutoFormat - StandardIf necessary, open the Clients form in Form Design View.
     
  2. Select all controls.
    (CTRL + A)
    Icon: TroubleProblem: CTRL + A did not select all of the controls
    Why:
    Either you were in Edit mode inside a control or the form did not have the focus.
    Solution: Click on a blank area of the background or click on the Details bar to put the focus in the form and try again.
     
  3. From the menu select  Format | AutoFormat .
     
  4. Icon: Experiment Experiment: Try out each of the pre-designed AutoFormat styles. You must click on OK in the dialog to actually apply the style to your form. There is no "preview" feature here.
    Observe carefully what changes - spacing, font, font size, effects, etc. Do you find one of these styles more attractive than the others? Most observers are not impressed with any of them! But they do get you started.
     
    Icon: TroubleProblem: Only some controls formatted:
    AutoFormat styles are applied to whatever is selected.
    Be sure that you have selected all controls when you want the AutoFormat to apply to the whole form.
     
  5. Select the style International as your final choice.
     
  6. Click on OK to close the AutoFormat dialog.
    Form Design View: International autoformat style applied 
    Notice that most of the controls are too close together for the shadow to show.

    Icon: TroubleProblem: Size of control(s) changed
    Your form may not look quite like the illustration. The fields that you enlarged may have switched back to the default sizes. It depends on exactly what AutoFormats you tried out and on exactly how your controls were aligned with each other.
    Solution: Resize and/or move any fields that lost their size or position.

Change Formatting

The default font for the International AutoFormat style is a bit hard to read and we need to get some more spacing between the controls.

  1. Form Design View: format label as Tahoma, 9, BoldSelect the ClientID label and format it as
      Font: Tahoma
      Font size: 9
      Bold
     
    TipThe name of the label, Label0, is on the toolbar at the left. What you see in the label is not necessary its name.
     
  2. Form Design View: Format ClientID controlSelect the ClientID control and format it as:
      Font: Tahoma
      Font size: 10

    TipThe name of the control is ClientID, which is the name of the field behind the control.
     
  3. With the ClientID control still selected, double-click the Format Painter button Button: Format Painter.
     
  4. Click on each of the controls to copy the formatting.
    The font, font size, and alignment of label with control are changed. This is great for most controls but not for a couple. Some labels are too narrow to show their text in this larger font. You will fix that shortly.
     
  5. After formatting all the controls, click the Format Painter button again to turn it off.
     
  6. Select all of the controls and labels (CTRL + A) and then size to fit. (Format | Size | To Fit)
    The labels all enlarge to show all of their text. The data controls do not change size.
     
  7. Inspect the changes.
     Form Design View: after FormatPainter
    The label for EmailAddress moved to the left of the control, even though you had moved the control below it. Two labels are partially hidden underneath their controls, OrganizationName and AlternativePhone.
     
  8. Form Design View: after correctionsEdit the labels to read Organization and AltPhone.
    (Click to select, click again to change to Edit mode, type, click out)
     
  9. Move the label EmailAddress back to its previous position, above the control, using the Move handle.
     

Change Spacing

Access lets you control the spacing between controls easily. Besides dragging things around, you can set all the spaces to be the same = evenly. Or you can increase or decrease horizontal or vertical spacing until you are satisfied.

  1. Select all controls with the key combo CTRL + A.
     
  2. Form Design View: after Format | Spacing | IncreaseFrom the menu select  Format | Vertical Spacing | Increase  .
    Whoops. Access has gone crazy!
    It has stretched some spaces out much too far and messed up the alignments across columns. Some controls may not have gotten any increase in spacing at all. <sigh>

    Note: Your form may look different, depending on exactly how your columns lined up on the grid.

    Let's try a smaller set of controls to help Access not get so confused.
     
  3. Undo.
     
  4. Form Design View: dragging on the ruler to select controlsClick in the horizontal ruler at the first mark at the left and drag across to the 1.5" mark. The labels and the controls in the first column are selected. (This is easier than dragging on the form itself!)
    Form Design View: First column spacing increased twice
     
     
  5. Again, from the menu select  Format | Vertical Spacing | Increase
     
  6. Repeat to increase spacing again.
    Now the controls in the first column are separated by enough space to show the shadow and a gap.  Looks better!
     
  7. Similarly, select the controls in the second column and increase spacing twice.
     
  8. Repeat for the third column.
    (You may only need to increase spacing once for the third column of controls.)
     
  9. Form Design View: after moving control downIf the DateUpdated label now overlaps the Notes control, drag the control down and drop it below the Notes control. The form will automatically resize.
     
  10. Icon: Save Save the form.  (Clients)
     

  11. Switch to Form View and navigate through the records. Does the data show in the controls with the new font and font size? Everything but a couple of international phone numbers should be showing nicely. Perhaps you should make some changes now to the phone number controls.


Edit Phone Controls

You need to edit the labels and enlarge the controls for phone numbers without making the form any wider.

  1. Switch to Form Design View.
     

  2. form Design View: Phone labels edited and resizedEdit the labels to remove "Phone" and "Number" from the text.
     

  3. Select  the labels and size to fit.
     

  4. Form Design View: Controls for phone numbersSelect the controls for the phone numbers.
     

  5. Drag them as wide to the left toward the labels without overlapping the Mobile label.
     

  6. Switch to Form View and verify that those long phone numbers are showing completely.
     


Draw Rectangle

The Toolbox has buttons for drawing lines and rectangles. These are used to divide or group areas on the form, or just for decorative effects.

  1. Icon: Design Switch to Form Design View.
     

  2. Form View: rectangle addedOn the Toolbox, click on the Rectangle button Button: Rectangle.
    The mouse pointer changes to the Draw Rectangle shapePointer: Draw Rectangle.
     

  3. Drag on the form to draw a rectangle around all of the phone numbers.
     

  4. Switch to Form View to see the effect of your rectangle. (It is hard to even see it in Design View!)
     

  5. Icon: Save Save the form.  (Clients)


Save As AutoFormat Style

Now that you have adjusted the spacing and changed the fonts, it would be nice to be able to apply this style to other forms.

  1. Dialog: AutoFormatIcon: Design Switch to Form Design View.
     

  2. From the menu select  Format | AutoFormat...
    The AutoFormat dialog opens.
     

  3. Click on the Customize button.
    The dialog Customize AutoFormat appears.
     

  4. Dialog: Customize AutoFormat - Create a new AutoFormat based on the Form 'Clients'.Click on the first choice, Create a new AutoFormat based on the Form 'Clients'
     

  5. Click on OK.
    A new dialog appears for you to name the new AutoFormat.
     

  6. Dialog: New StyleAdd your initials to the suggested name, like International-xxx.
     
     

  7. Click on OK.
    Your new style is listed in the AutoFormat dialog. You will use it later.
     Dialog: AutoFormat - International-xxx
    TipIf you are sharing your computer with other students who are doing these lessons, you may see the styles that they created.
     

  8. Click on Close to close the dialog.


Apply Custom AutoFormat

Now that you have a customized AutoFormat style, you can apply it to other forms. That's one way to find out what formatting choices were actually saved.

  1. Open the previously created form named Staff-format single.
    You created this form with the Form Wizard and then formatted some controls yourself.
     Form View: Staff-format single
     
  2. Icon: Design Switch to Form Design Viewif necessary.
    Be sure not to select any of the controls. You want to apply an AutoFormat to the whole form this time.
     
  3. From the menu select  Format | AutoFormat...
     
  4. Select your new style, International-xxx, where the xxx stands for your own initials.
     
  5. Click on OK to apply the style.
    You see a message box telling you that there is no information about how to format the Form Header section. You did not have a form header in the form that you used as the pattern for the AutoFormat style.
     Message: The style you have applied has no information about the 'Form Header' section.
  6. Click on OK to close the message.
    You get another message saying the same thing about the Form Footer.
     
  7. Click on OK.
    Finally the formatting is applied to your form.
     
  8. Form Design View: Staff-AutoformatInspect the form. What changed?
     
    Humph! This did not work quite as well as you may have hoped.
     
    The fonts and font sizes were applied, but the spacing was not changed and the controls and labels did not change size. This looks like it will take a good deal of work to straighten out. Not now.
     
  9. Icon: Save Save the form as Staff-Autoformat.
    We won't take the time right now to straighten out the layout.
     
  10. Leave the form open.
     

Form Header/Footer

You can copy the form header from the Staff-Autoformat form and then edit it.

  1. Form Design View: Staff-autoformat  - selecting unbound controls in form headerIn the Form Design View of the Staff-Autoformat form, click on the unbound control World Travel Inc.
     
  2. Hold the SHIFT key down and click on the unbound control Staff.
    Both controls are now selected.
     
  3. Copy.
     
  4. Switch back to the Clients form in Form Design View.
     
  5. Menu: View | form Header/footerFrom the menu select View | Form Header/Footer
    Two new blank sections appear, at the top and bottom of the form.
    Form Design View: Form Header and Form Footer
     
  6. Click on the Form Header bar to select the section.
    The Form Header bar turns black.
     
  7. Paste.
    The two controls that you copied appear in the Header section.
    The section automatically enlarged to hold the controls.
     
  8. Click on the Staff control and click again to go to Edit mode.
     
  9. Edit the text to read Clients.
     
  10. Icon: Save Save the form as Clients-header.
     
  11. Switch to Form View to see how your changes look.
    The form looks a lot better! If your Design window was sized like mine, to show the whole form, then in Form View there is a lot of extra space at the bottom. In the next lesson we will investigate why.

    Form View: Form Header


Apply Your Skills: Revise the Staff Form

You have a nice layout for the Clients form but the Staff form is still squeezed together. It's time for you to apply the formatting skills you have learned.

  1. Form Design View: Staff-AutoformatSwitch to the Staff-Autoformat form in Form Design View.
     
  2. Resize and move the controls in the Detail section to approximate the illustration below:
    • Most text controls should be 1" wide.
    • Enlarge and rename as needed to match illustration.
    • Resize the Photo control to be 1.5" x 1.5".
    • Move the controls to positions shown in illustration
    • Draw a line above Hobbies and Notes using the Line tool in the Toolbox bar.
    • Resize the form to be just large enough for the controls.
  3. Icon: Save Save the revised form as Staff-formatted.

    Form View: Staff-formatted