Forms and Reports

In Microsoft Access, forms and reports represent compound documents. They may contain object frames that hold OLE objects, such as a company logo, a chart of monthly sales, or recorded instructions for using a form.

You can use the same three methods learned earlier (Insert Object, Edit Paste Special, and Edit Paste Link) to add an OLE object to your forms and reports. Regardless of which method you use, the OLE objects are stored as a part of your form or reports.

There are two types of OLE objects that you can place on a form or report: bound and unbound objects. If you place an unbound object on the form, it is stored with the form. If you create a bound object on the form, it is stored in the underlying table.

Object Frame (Unbound): Stored with Form or Report

Bound Object Frame: Stored in a table

In design mode on a form or report, the toolbox presents these two methods to add an OLE object. Select the Object Frame (Unbound) tool or Bound Object Frame tool from the toolbox and draw a rectangle of the size you wish the object to be. When you release the mouse button, Microsoft Access prompts you to select the OLE object you wish to use to create the object. Exiting the OLE object returns you to Microsoft Access, and the object you created is embedded.

In-Place Activation

Some OLE objects can be activated from within the control containing the object—a bound or unbound object frame. When such an object is activated, the user can edit the object (or perform some other action) from inside the boundaries of the control. This feature is called in-place activation. Typically, in-place activation is accomplished with a double mouse click. However, using the object frames's AutoActivate property, you can control how and when in-place activation takes place.

Object Frame Properties

You can modify the appearance and behavior of an OLE object stored in an object frame within Microsoft Access by setting the following properties.

Property

Description

Action

Determines the operation to perform on an object, such as embedding an object or linking an object. This property is available only at run time. See the file CONSTANT.TXT for a list of OLE constants you can use with this property.

Class

Identifies the application that supplied the object and identifies the object type (for example, Word.Document or Excel.Sheet).

Display Type

Either content or icon.

OLETypeAllowed

Determines the type of object a control can contain (linked, embedded, or either).

Size Mode

Determines how an object is displayed in the frame (clipped, zoom, stretch)

SourceDoc

Determines the file to link to when creating a linked OLE object (for example, SHEET1.XLS).

SourceItem

Determines the data within the file to be linked.

Update Options

Manual or automatic.

Verb

Determines which method of the object is called upon activation.


These properties can only be used with existing OLE objects created using the Insert Object or Paste Special dialog boxes. To change the type of OLE object in a control, you can change the object's properties in the property sheet or by using Access Basic.

The properties you need to set are determined by the type of OLE object you're modifying. The Class, OLETypeAllowed, SourceDoc, and SourceItem properties specify information Microsoft Access uses to manipulate the OLE object.