Microsoft KB Archive/209732

= ACC2000: No Error Message Occurs with Multiple Dynaset.Close Statements Based on a Form =

Article ID: 209732

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209732



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

This article applies only to a Microsoft Access database (.mdb).



SYMPTOMS
If you use code to create a recordset that is based on a form, you can use multiple Dynaset.Close statements without generating the expected error message.



MORE INFORMATION
NOTE: The Dynaset property is included in Microsoft Access 2000 only for compatibility with earlier versions. It is recommended that you use the RecordsetClone property instead. In Microsoft Access 7.0, 97, and 2000, there is no Dynaset object; therefore, you cannot declare a variable as a Dynaset.

Steps to Reproduce Behavior
 Start Microsoft Access and open the sample database Northwind.mdb. Open the Customers form in Form view.  Create the following new module. Function MultiClose Dim MyDyna as Recordset Set MyDyna=Forms![Customers].Dynaset MyDyna.Close MyDyna.Close End Function  If the Immediate window is not already visible, click Immediate Window on the View menu, or press CTRL+G. Run the code that you created in step 3 by typing ? MultiClose in the Immediate window. Note that there are no error messages, even though the code attempts to close the Dynaset more than once.

<div class="references_section">