Microsoft KB Archive/225949

= ACC2000: Error Converting a Database with a Large Number of Forms That Have Modules =

Article ID: 225949

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q225949



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

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



SYMPTOMS
If your Microsoft Access 97 database contains several hundred forms, you may experience the following corruption error when you convert the database to the Access 2000 format:

The Visual Basic for Applications project in the database is corrupt.

If the database is successfully converted, you cannot view any module in the project.



CAUSE
This problem can happen if your Access 97 database has several hundred forms and each form has a Visual Basic for Applications module.



RESOLUTION
Open your original database in Access 97 and delete any forms that you do not need. Also, you may want to move some of the forms to another Access database before you convert the database. Continue deleting or moving forms out of the database until you no longer receive the error.

Also check to see if any form has a blank or unused module. If so, set the HasModule property of the form to No.



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
 Create a new blank database in Access 97 and name it ManyForms.mdb. In the new database, click Modules under Objects, and then click New.  Type the following code in the new module. The code creates 900 forms, each with the HasModule property set to Yes. Sub CreateManyForms

Dim f As Form, i As Integer Application.Echo False

For i = 1 To 900 Set f = CreateForm f.HasModule = True DoCmd.Close acForm, f.Name, acSaveYes Next

Application.Echo True

End Sub  On the View menu, click Debug Window.  In the Debug window, type the following line, and then press ENTER: CreateManyForms </li> Close the module and don't save the changes.</li> Close the database and quit Access 97.</li> Open Access 2000.</li> On the File menu, click Open.</li> Locate the ManyForms.mdb and open it.</li> When prompted, click Convert Database, and then click OK.</li> During conversion, you receive the following message:

The Visual Basic for Applications project in the database is corrupt.

</li> Click OK.</li> If the conversion process creates the new database, open any form in Design view.</li> On the View menu, click Code. Note that no module opens.</li></ol>

Additional query words: pra

Keywords: kberrmsg kbbug kbpending KB225949

-

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

© Microsoft Corporation. All rights reserved.