Microsoft KB Archive/200216

= ACC2000: How to Programmatically Create a New Data Access Page =

Article ID: 200216

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q200216



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

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

For a Microsoft Access 2002 version of this article, see 299018.



SUMMARY
This article shows you how to use the CreateDataAccessPage method to programmatically create data access pages. This method allows you to specify the name and path of a new data access page, as well as allowing you the flexibility of linking to existing pages.



MORE INFORMATION
To create a new data access page programmatically, follow these steps:  Open the sample database Northwind.mdb, and then create a new module.  Type the following procedure into the new module: Sub MyNewPage(MyPageName as String) Dim dapNewPage As DataAccessPage Set dapNewPage = Application.CreateDataAccessPage(MyPageName,True) DoCmd.Close acDataAccessPage, dapNewPage.Name, acSaveYes End Sub   Run this new procedure by typing the following code into the Immediate window, and then pressing ENTER: MyNewPage("MyTestPage")  In the Database window, click Pages under Objects, and note that a new page named MyTestPage was created.

