Microsoft KB Archive/120568

= ADT2: Errors Using Recordset Methods on Data Outline Control =

Article ID: 120568

Article Last Modified on 6/13/2001

-

APPLIES TO


 * Microsoft Access Developer's Toolkit 2.0

-



This article was previously published under Q120568



SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.

When you are writing code for the data outline control, you can create a Recordset-like object using the GetRecordSetClone method on the data outline control object. However, when you use standard Recordset methods on this object, you receive compile errors.



RESOLUTION
In your code, enclose the methods used on the Recordset-like object in brackets. For example, for an object called RecSet created with the GetRecordSetClone method, use RecSet.[movefirst] instead of: RecSet.movefirst



STATUS
This behavior no longer occurs in Microsoft Access Developer's Toolkit for Windows 95 version 7.0 using the Microsoft Data Outline Control version 1.1.



Steps to Reproduce Behavior
 Open the sample database NWIND.MDB. Create a new form not based on any table or query and called it TestOutline. Make sure that the Control Wizards button in the toolbox is selected (the button should appear sunken). From the Edit menu, choose Insert Object. In the Insert Object dialog box, select the Insert Control option button, and then select Data Outline Control in the Control Type box. Choose OK. In the "For each level, what data do you want the Data Outline Control to display?" screen, select the Customers table in the Table/Query box for level 1, and then choose the Finish button. From the View menu, choose Code. In the Object box on the toolbar, select Embedded0 (the data outline control). In the Procedure box, select Enter.</li>  Enter the following code in the module: Sub Embedded0_Enter

Dim DOC As Object      'Data outline control Dim RecSet As Object   'Recordset

Set DOC = Forms!TestOutline!Embedded0.Object Set RecSet = DOC.GetRecordsetClone(1)

RecSet.MoveFirst

End Sub </li> Compile the code by choosing Compile All from the Run menu. Note that you receive the compile error message "Method not applicable for this object."</li></ol>

<div class="references_section">