Lessons Logo

Accessories for Form and Report Design

 

Introduction

Accessories for form and report design are objects you can add or insert to make your database attractive. Once again, we mention objects that are available, not because you must use them but so you would be aware of the possibilities. Some accessories can make your database grow and some others can be distracting. Therefore, use them as need be.

 

Pictures

A picture is a graphical object that can be used either as the background of a form or report or can be positioned on top of a database object. Before using such a picture, you should prepare it or at least have it handy.

To use a picture as the background of a form or report, in Design View, open the Properties window of the form or report. In the Format tab, click the Picture field to reveal its ellipsis button. Then use that button to locate and retrieve the picture. Once added to the form or report, you can use some other properties to specify how the picture would be displayed.

You may have realized that when you add pictures to a form, the database grows tremendously. This is because Microsoft Access in fact "puts" or "embeds" the picture in the form. An alternative to this is to only create a link to the picture. To specify this, you can use the Picture Type property whose values are Embedded and Linked.

The Picture Size Mode property specifies whether the picture should be kept "as is", in which case you would select or keep the default Clip value. If you set it to Stretch, the picture would be expanded to accommodate its form or report. If you select Zoom, the picture would be zoomed

The Picture Alignment property specifies how the picture would be "glued" with respect to its host. Its options, Top Left, Top Right, Center, Bottom Left, and Bottom Right, are really self explanatory.

When you add a picture to a form or report, a single copy of that picture is used. If the picture is smaller than its host, it would use only the area in which it fits. This can make it appear weird especially depending on the value you select for the Picture Size Mode and the Picture Alignment properties. If the picture is small, you can use the Picture Tiling property to make "repeat" itself throughout the area in which it is used.

If you are adding the picture to a report, you can make it available only to the first page or to all pages. This option is set using the Picture Pages property. Of course, it is available only for the report

 

Practical Learning: Using Pictures

  1. Open the Danilo Pizza database and click Forms in the Database window
  2. Double-click the OrderProcessing2 form to open it
  3. After viewing it, switch it to Design View
  4. To remove the top and bottom sections, right-click the title bar of the form and click Form Header/Footer
  5. Double-click the button at the intersection of both rulers to access the properties of the form. In the Properties window, set the Records Selectors property to No and click Picture
  6. Click the ellipsis button of the Picture property
  7. Locate the DaniTheme picture. Click it and click OK
  8. Set the Picture Alignment to Top Left
  9. Click anywhere in the Detail section of the form and press Ctrl + A
  10. Move the group of controls so they are away from the design. You may have to go through trial and error, that is, switch between views, to get it better. Also, if you are using a different operating system than Windows XP, you may need to change the Back Color of the labels on the group boxes to Red: 236, Green: 233, and Blue: 216 to synchronize with the form's background:
     
  11. Save and close the form
 

The Rectangle

The rectangle is not a control (for example, it doesn't "own" of fire events; in other words, it doesn't programmatically communicate with the operating system, it doesn't store or receive data nor does it provide data). It is a graphical object primarily intended to enhance the appearance of sections or controls on forms and reports. There is no formal directive on how to use the rectangle.

There are two main reasons you would add a rectangle to a form. You can use it to "hold" other controls. For example, if you want to isolate a group of controls, you can include them inside of a rectangle like the Car Options in this form:

 

Practical Learning: Using the Rectangle Tool

  1. Open the Rockville Techno1 database
  2. Open the Payment Methods1 form in Form View then switch it to Design View
  3. If the Toolbox is not available, on the Form Design toolbar, click the Toolbox button
    On the Toolbox, click the Rectangle
  4. Click under the Detail bar on the form
  5. If the Properties window is not available, right-click the newly added rectangle and click Properties.
    In the Properties window, change the following properties:
    Left = 0.1
    Top = 0.0833"
    Width = 3.0417"
    Height = 0.9583"
    Special Effect = Raised
  6. Save and preview the form:
     
  7. Close the form
  8. Open the Employees report and switch it to Design View
  9. On the report, click the rptEmployees label on the top section.
  10. On the Properties window, click Caption and change the caption of the label to read: Rockville Technologies - Employees
  11. Set the following properties:
    Left = 1"
    Top = 0.1667"
    Width = 4.3333"
    Height = 0.3542"
    Back Style = Transparent
  12. From the Toolbox, click the Rectangle tool Rectangle and click on the top-left corner under the Report Header bar.
  13. While the rectangle is still selected, on the Properties window, change the following characteristics: Left = 0.125"; Top = 0.0833"; Width = 5.875"; Height = 0.5":
     
  14. Save, preview, and close the report.
  15. Open the My Company Information form in Form View:
     
    The My Company Information Dialog Box
  16. To switch it to the other display, right-click its title bar and click Design View.
  17. On the Toolbox, click the Rectangle tool Rectangle
  18. On the form, click on the top-left corner under the Form Header bar.
  19. While the newly added rectangle is still selected, on the Properties window, change the following characteristics:
    Left = 0.1021"
    Top = 0.0833"
    Width = 5.25"
    Height = 0.4583"
    Back Color = 9783808
    (equivalent to Red=0; Green=74; Blue=149)
    Special Effects = Shadowed
  20. While the rectangle is still selected, on the main menu, click Format -> Send To Back
  21. Save and preview the form. Then switch it back to Design View
  22. On the Toolbox, click the Rectangle tool Rectangle
  23. On the form, click on the top-left corner under the Detail bar
  24. While the newly added rectangle is still selected, on the Properties window, change the following characteristics: 
    Name = boxInternal
    Left = 0.2042"
    Top = 0.2083"
    Width = 5.0417"
    Height = 2
    Back Color = 16771538
    (equivalent to Red=210; Green=233; Blue=255)
    Special Effect = Raised
  25. While the rectangle is still selected, on the main menu, click Format -> Send To Back
  26. On the Toolbox, click the Rectangle tool Rectangle
  27. On the form, click on the top-left corner under the Detail bar
  28. While the newly added rectangle is still selected, on the Properties window, change the following characteristics: 
    Name = boxExternal
    Left = 0.1"
    Top = 0.0833"
    Width = 5.25"
    Height = 2.1667"
    Back Color = 9783808
    (equivalent to Red=0; Green=74; Blue=149)
    Special Effect = Sunken
  29. While the rectangle is still selected, on the main menu, click Format -> Send To Back
  30. Save and preview the form:
     
    A form with various rectangles
  31. Close the form.
 

The Line

Like the rectangle, Microsoft Access provides another tool used for form and report design. The line is used to trace horizontal, vertical, or diagonal lines of various preset widths. Once again, the use, position, and orientation of a line only depends on your goal.

 

Practical Learning: Using the Line Tool

  1. Open the Grier Summer Camp database
  2. Open the Employees report and switch it to Design View
  3. Enlarge the window to be able to see the right border
  4. On the Toolbox, click the Line tool Line
  5. On the report, position the mouse at the lower-left corner of the Employee ID label until the mouse pointer appears as +
     
    Starting a line
  6. Click and drag in the right direction until you reach the 6 measurement:
     
  7. To move the line, position your mouse on it until the mouse pointer turns into an open hand , click and drag in the desired direction.
    You can also move the line when the mouse pointer is a pointing finger
  8. To narrow the line, position your mouse on one of its borders until the mouse pointer turns into a diagonal double arrow. Then click and drag in the desired direction
  9. Draw a line similar to the previous line for each label on the report except the Notes label
  10. Save and preview the report
  11. Switch the report back to Design View
  12. On the Toolbox, click the Line tool Line
  13. On the report, click under the Administrative Staff shaded label
  14. While the newly added line is still selected, on the Formatting toolbar, click the arrow of the Line/Border Width button and select 2
  15. Move the label and place it exactly on the lower border of the shaded label. Enlarge the line so it has the same width as the shaded label:
     
  16. Save and preview the report. Then return to Design View.
  17. On the Toolbox, click the Line tool Line and click in the white area of the report under the Page Header bar.
  18. Position the line just under the GRIER SUMMER CAMP label and make sure the line has the same width as the report (6.5")
     
    Adding a line to a report
  19. On the Toolbox, click the Line tool again and click in the Page Header section
  20. While the line is still selected, on the Formatting toolbar, click the arrow of the Line/Border Width button and select 3
  21. Move the new line to the extreme left and widen it so it has the same width as the previous line. Also place the new line under the previous line:
     
    Designing Lines
  22. Save and preview the report:
     
    A Report
  23. Close the report.
 

Bound Objects

When reviewing data types, we saw that a bound object is one that is tied to an existing field on a table. To add such a bound object to a form or report, on the Toolbox, you can click Bound Object Frame and click in the desired area of the form or report. Since the object is (supposed to be) bound to a field on the source table (or the source report), the most important piece of information you should provide is the table's (or query's) field that holds the bound data. This is specified in the Record Source property.

 

Practical Learning: Binding an Object

  1. Open the Video Collection2 database
  2. Open the Videos table in Design View
  3. Right-click Available and click Insert Rows
  4. In the empty field name, type Picture and set its Data Type to OLE Object
  5. Save the table and switch it to Datasheet View
  6. Right-click the first field under the Picture column and click Insert Object...
  7. On the Insert Object dialog box, click the Create From File radio button and click Browse...
  8. If the File Name box contains any name, delete it and select All files from the Files of Type combo box.
    On the list of files, click FatalAttraction and click OK.
  9. On the Insert Object dialog box, click OK
  10. Proceed in the same way to add available pictures of some of the videos
  11. Close the table
  12. Open the Videos report and switch it to Design View
  13. On the Toolbox, click the Bound Object Frame button
  14. On the report, click the area under the Picture label
  15. While the bound frame is still selected, on the Properties window, change the properties as follows
    Name = pctVDOPicture
    Record Source = Picture
  16. Delete the Picture label that was on the report and the label that was added with the control
  17. Switch the report to Print Preview to view it
  18. Switch it back to Design View. Then resize the bound control so it doesn't use more space than it needs
  19. Navigate to the second record
     
  20. Save and close the form.
 

Unbound Objects

Instead of a field whose data is linked to another field of the database, you can have an object on your form or report to simply complete the design of the parent object. That is the case for logos or fine prints on forms and reports.

On a form or report, an object whose data is not linked to a specific record is referred to as unbound. To add an unbound object, on the Toolbox, you can click the Bound Object Frame button and click on the form or report. If the Control Wizard button is clicked on the Toolbox, a wizard will help you select the object you want to add to your form or report.

 

Practical Learning: Adding an Unbound Object

  1. Open the Grier Summer Camp database
  2. Open the Employees report and switch it to Design View
  3. On the toolbox, make sure that the Control Wizard button is clicked
    Click the Unbound Object Frame button Unbound Object Frame
  4. On the report, click on the top-left side of the white area under the Page Header bar:
     
    Adding an Unbound Object Frame
  5. In the Insert Object dialog box, click the Create From File radio button and click Browse.
  6. If the File Name contains something, delete it. In the Files Of Type combo box, select All Files.
    In the list of files, click GSCLogo and click OK.
  7. On the Insert Object dialog box, click OK.
  8. While the logo is still selected, On the Properties window, set the Border Style to Transparent.
    If the logo is not positioned the way you like, you can move it using the open hand or the pointing finger mouse cursors.
  9. Save the report and switch it to Print Preview:
     
    A Report
  10. If you have a printer, print records from 1 to 3.
    Navigate through records to see the result.
  11. Close the report.
 

Previous Copyright 2002-2007 Yevol Next