Microsoft KB Archive/223205

= ACC2000: Properties of the DataAccessPages Object May Return Error Message =

Article ID: 223205

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q223205



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

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



SYMPTOMS
When you use a property of the DataAccessPages object, you may get one of the following error messages:

Run-time error '2018':

The data access page name ' ' you entered is misspelled or refers to a data access page that isn't open or doesn't exist.

-or-

Run-time error '2019':

The number you used to refer to the data access page is invalid.



CAUSE
You get one of these error messages when you try to use a property of the DataAccessPages object and the data access page is open in Microsoft Internet Explorer. The DataAccessPages object is looking for pages that are open in Microsoft Access. Because the page is open in Internet Explorer, and not in Access, the DataAccessPages object does not recognize it as being open.

NOTE: When you click the Web Page Preview command on the File menu, the page does not open in Access. It opens in Internet Explorer.



RESOLUTION
To use one of these properties, you must have the page open in Design view or Page view in Access.



MORE INFORMATION
The properties of the DataAccessPages object with which you could see these errors are as follows:
 * ConnectionString
 * CurrentView
 * Document
 * Name
 * Tag
 * Visible
 * WindowHeight
 * WindowWidth

Steps to Reproduce Behavior
 Open the sample database Northwind.mdb. In the Database window, click Pages under Objects, and then click New. Click Page Wizard and click OK. In the Tables/Queries list, click Table: Categories. Move CategoryID from the Available Fields list to the Selected Fields list, and then click Finish.  Press CTRL+G to open the Immediate window. Type the following line, and then press ENTER: ?Application.DataAccessPages(0).ConnectionString Note that this returns the connection string. </li> Press ALT+F11 to switch back to Access.</li> On the File menu, click Save.</li> In the Save As Data Access Page dialog box, note the name of the page, and then click Save.</li> On the File Menu, click Close.</li> Right-click the page that you saved in step 8. On the shortcut menu, click Web Page Preview.</li> Switch back to Access.</li>  Press CTRL+G to open the Immediate window. Type the following line, and then press ENTER: ?Application.DataAccessPages(0).ConnectionString Note that this returns the second error listed in the "Symptoms" section. </li></ol>

Additional query words: DAP prb

Keywords: kberrmsg kbdap kbprb KB223205

-

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

© Microsoft Corporation. All rights reserved.