Microsoft KB Archive/287443

= ACC2002: &quot;Microsoft Access Failed to Create the Visual Basic Module&quot; Error Message When You Try to Edit an Object in a Replica =

Article ID: 287443

Article Last Modified on 9/25/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q287443



Advanced: Requires expert coding, interoperability, and multiuser skills.

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



SYMPTOMS
When you try to open a form or a report in a replicated database, and if the database is in Microsoft Access 2000 format, and you if then try to open the Visual Basic Editor, you receive the following error message

Microsoft Access failed to create the Visual Basic Module.

If your database is on a network drive, check your network connection, and then try again.

and then you do not have any options available in the replica to create a module. This behavior does not occur with data access pages.



CAUSE
In Access 2002, when Access tries to open an object in Design view, replica or not, Access opens the object in an update state. If Access is unable to do so, Access tries to open the object in a read-only state. This is different from Access 2000, where, in a replica, Access opens the object read-only from the beginning.



RESOLUTION
If possible, develop your application fully before you replicate and distribute it. If you have to make design changes later, distribute the front-end database separately from the tables.



MORE INFORMATION
You will not receive the error message if the database is in Access 2002 file format. But even in Access 2002 file format, you cannot save design changes to a class module in a replica.

For maximum replica-set stability, Microsoft does not recommend replicating Access objects. There have been reported instances of design changes to forms and modules not propagating successfully to all replicas in a replica set.

Steps to Reproduce the Behavior
 Create a new blank database. Verify that the database format is 2000. Create a new table in the database with two fields. Save the table as Table1 . Create a new autoform in the database that is based on the Table1 table. Replicate the database by pointing to Replication on the Tools menu, and then clicking Create Replica.</li> Close the Design Master.</li> Open the replica.</li> Open the form in Design view.</li> Click Yes in the message that you receive when you try to open the form in Design view.</li> Add a command button to the form.</li> Create an event procedure for the Click event for the command button. Use the builder to open the Visual Basic Editor. Note that you receive the following error message:

&quot;Microsoft Access failed to create the Visual Basic Module.

If your database is on a network drive, check your network connection, and then try again.&quot;

</li></ol>

Keywords: kberrmsg kbnofix kbprb KB287443

-

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

© Microsoft Corporation. All rights reserved.