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

ID: Q225949


The information in this article applies to:
  • Microsoft Access 2000

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 this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new blank database in Access 97 and name it ManyForms.mdb.


  2. In the new database, click Modules under Objects, and then click New.


  3. Type the following code in the new module. The code creates 900 forms, each with the HasModule property set to Yes.


  4. 
    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 
  5. On the View menu, click Debug Window.


  6. In the Debug window, type the following line, and then press ENTER:


  7. 
    CreateManyForms 
  8. Close the module and don't save the changes.


  9. Close the database and quit Access 97.


  10. Open Access 2000.


  11. On the File menu, click Open.


  12. Locate the ManyForms.mdb and open it.


  13. When prompted, click Convert Database, and then click OK.


  14. During conversion, you receive the following message:


  15. The Visual Basic for Applications project in the database is corrupt.
  16. Click OK.


  17. If the conversion process creates the new database, open any form in Design view.


  18. On the View menu, click Code. Note that no module opens.


Additional query words: pra

Keywords : kberrmsg kbdta CnvProb
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: September 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.