Microsoft KB Archive/209788

= ACC2000: Properties Collection Returns Error for CurrentProject and CurrentData Objects =

Article ID: 209788

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209788



This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

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



SYMPTOMS
All object collections under the CurrentProject and CurrentData objects contain a Properties collection. However, when you try to refer to the Properties collection of any object in a collection under the CurrentProject or CurrentData object, you may receive the following error message:

Run-time error '2467':

The expression you entered refers to an object that is closed or doesn't exist.



RESOLUTION
Although you cannot use the Properties collection to refer to properties of these objects, you can refer to the properties directly. For example, use: Debug.Print CurrentData.AllTables(1).Name instead of: Debug.Print CurrentData.AllTables(1).Properties("Name")



STATUS
This behavior is by design.



Steps to Reproduce Behavior
NOTE: The syntax used in the following steps only works with the CurrentProject.All and CodeProject collections.  Open the sample project NorthwindCS.adp. On the Tools menu, point to Macro, and then click Visual Basic Editor. On the View menu, click Immediate Window.  In the Immediate Window, type the following code, and then press ENTER: ?CurrentData.AllTables(1).Properties.Count </ol>

Note that you receive the error message mentioned in the "Symptoms" section of this article.

Additional query words: prb

Keywords: kberrmsg kbprb KB209788

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.