Microsoft KB Archive/131934

= ACC: Cannot Reference OLE Control in Datasheet View =

Article ID: 131934

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q131934



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you reference a form's OLE control in an expression or a procedure, you may receive the following error message.

In Microsoft Access 97
Run-time error '2771': The bound or unbound object frame you tried to edit doesn't contain an OLE object.

Use the Object command on the Insert menu to add an OLE object to the bound or unbound object frame.

In Microsoft Access for Windows 95 version 7.0
The unbound or bound object frame you tried to edit doesn't contain an OLE object.

In Microsoft Access version 2.0
Can't obtain this property setting. The property may not be available in this view, or an error may have occurred.



CAUSE
When a form is open in Datasheet view, you cannot reference the form's unbound OLE control.



RESOLUTION
Do not reference OLE controls in forms that are displayed in Datasheet view.

NOTE: You can check a form's CurrentView property setting to determine whether the form is displayed in Datasheet, Form, or Design view.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 2.0, 7.0, and 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
 Create a new form not based on a table or query. Insert the Calendar Control. In the Properties dialog box, change the name of the Calendar Control to "CalendarCtl" (without the quotation marks). View the form in Datasheet view  Open the Debug window (or Immediate window in version 2.0), and type the following line: ? Forms!Form1!CalendarCtl.object.value Note that you receive an error message because the form that the expression references is open in Datasheet view. </li></ol>

<div class="references_section">