ACC2000: How to Use In-place Activation with OLE Objects (209108)
The information in this article applies to:
This article was previously published under Q209108 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SUMMARY
Microsoft Access supports in-place activation of OLE objects in a form's Form view. Also, in a form or report's Design view, activation of an OLE object causes the object's original application to run in the background as a server application (if the original application is available), so you can edit the object in Microsoft Access. However, in a table or a query, or in a form's Datasheet view, when you activate an OLE object, the original application opens to allow you to edit the object.
MORE INFORMATION
In-place activation of an OLE object allows you to edit or otherwise
manipulate the object without switching to the object's original
application. For example, you can edit an embedded document that was
created in Microsoft Word for Windows without starting Word for
Windows.
When you edit an OLE object in-place, the object's border becomes a hatched
frame and the menus and menu options supported by the object's original
application are added to the standard Microsoft Access menus. Toolbars
supported by the object's original program may also be displayed.
The object's original program runs in the background and supplies the
functionality it supports for the object, but the program is not
visible and does not appear on the Windows taskbar.
For an OLE object to be activated in-place, the following must be true:
- The object must have been created in an OLE
server program that supports in-place activation.
- The object must be displayed in an object frame on a form that is open in Form view.
- The frame's Enabled property must be set to Yes.
If the frame's Locked property is set to Yes, you are able to edit the object, but you are not able to save the changes. You may receive one of the following messages when you attempt to save the form:
Microsoft Access can't save your
changes to this bound OLE object.
Either you don't have permission to write
to the record in which the object is
stored, or the record is locked by
another user. Copy the object to the
Clipboard (select the object and click
Copy on the Edit menu), and click Undo
Current Record on the Edit menu. Then
open the application you used to create
the object, paste the object from the
Clipboard, and then save it.
The object is locked, so any changes you
make will be discarded when the form is
closed.
Click Save As/Export on the File menu and
save the object under a different name.
If the object is linked, you can activate it in-place, but you cannot edit
it in-place.
The AutoActivate property controls how an object is activated. The default value is Double-Click, which allows you to double-click the object to activate it. If you set the property to Manual, you need to select the object, click object type on the Edit menu, and then click Edit to activate it. Setting AutoActivate to GetFocus (available only in unbound object frames) forces activation of the object when it receives focus on the form.
The following is an example of how to create an OLE object that supports
in-place activation:
- Start Microsoft Access and either create or
open any database or project.
- In the Database window, click Forms, and then click New.
- In the New Form dialog box, click Design View, and then click OK to open a new form in Design view, not based on any table or query.
- Using the Unbound Object Frame tool, create a new frame on the form.
- In the Insert Object dialog box, under Object Type, click Microsoft Graph 2000 Chart, and then click OK.
- Set the frame's Enabled property to Yes and its Locked property to No.
- On the View menu, click Form View.
- Double-click the embedded graph.
The graph's border changes to a hatched frame, and several menus and menu options change.
- Click anywhere in the form outside of the OLE object to deactivate the graph.
REFERENCESFor more information about in-place activation, click Microsoft Access Help on the Help menu, type AutoActivate Property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about the Locked and Enabled properties of frames, click Microsoft Access Help on the Help menu, type Enabled, Locked Properties in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about whether or not a specific object application
supports in-place activation, refer to that application's documentation.
Modification Type: | Major | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto KB209108 |
---|
|