ADT2: Errors Using Recordset Methods on Data Outline Control
ID: Q120568
|
The information in this article applies to:
-
Microsoft Access Developer's Toolkit, version 2.0
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.
MORE INFORMATION
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.
- 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
- 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."
REFERENCES
Microsoft Access Developer's Toolkit "Advanced Topics," version 2.0,
Chapter 6, "Using OLE Custom Controls"
Additional query words:
Keywords : kberrmsg kbprg MdlRcd
Version : WINDOWS:2.0
Platform : WINDOWS
Issue type : kbprb