Microsoft KB Archive/225976

= ACC2000: Running Code with RepaintObject on a Data Access Page Erases Recent Changes =

Article ID: 225976

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q225976





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 run the RepaintObject method of the DoCmd object on a data access page, you may lose the most recent changes that you made to the design of the page.



CAUSE
The RepaintObject method reloads the page from the persisted state on disk.



RESOLUTION
Make sure that you either save the page or view the page in Page view before you run Visual Basic for Application code that contains the RepaintObject method.

Saving the Page
To manually save the page, click Save on the File menu.

-or-

To programmatically save the page, use a line similar to the following: DoCmd.Save acDataAccessPage, " "

Viewing the Page in Page View
To manually view the page in Page view, click Page View on the View menu, and then click Design View on the View menu.

-or-

To programmatically view the page in Page view, use a line similar to the following: DoCmd.OpenDataAccessPage, " ", acDataAccessPageBrowse



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Open the sample database Northwind.mdb. In the Database window, click Pages under Objects, and then click New. In the New Data Access Page dialog box, click OK. Add a command button to the page.</li> On the File menu, click Save. Save the page as dapLostButton.</li> Add a second command button to the page.</li> Press CTRL+G to open the Immediate window in the Visual Basic Editor.</li>  Type the following line in the Immediate window, and then press ENTER: DoCmd.RepaintObject acDataAccessPage, "dapLostButton" Note that the second command button is no longer on the page. </li></ol>

Additional query words: pra gone missing lost

Keywords: kbbug kbdap kbpending KB225976

-

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

© Microsoft Corporation. All rights reserved.