Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Use In-place Activation with OLE Objects


View products that 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).

↑ Back to the top


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.

↑ Back to the top


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.
-or-
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:
  1. Start Microsoft Access and either create or open any database or project.
  2. In the Database window, click Forms, and then click New.
  3. 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.
  4. Using the Unbound Object Frame tool, create a new frame on the form.
  5. In the Insert Object dialog box, under Object Type, click Microsoft Graph 2000 Chart, and then click OK.
  6. Set the frame's Enabled property to Yes and its Locked property to No.
  7. On the View menu, click Form View.
  8. Double-click the embedded graph.
    The graph's border changes to a hatched frame, and several menus and menu options change.
  9. Click anywhere in the form outside of the OLE object to deactivate the graph.

↑ Back to the top


References

For 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.

↑ Back to the top


Keywords: KB209108, kbhowto

↑ Back to the top

Article Info
Article ID : 209108
Revision : 2
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 326