ACC2002: "Microsoft Access Failed to Create the Visual Basic Module" Error Message When You Try to Edit an Object in a Replica (287443)



The information in this article applies to:

  • Microsoft Access 2002

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

  1. Create a new blank database.
  2. Verify that the database format is 2000.
  3. Create a new table in the database with two fields. Save the table as Table1.
  4. Create a new autoform in the database that is based on the Table1 table.
  5. Replicate the database by pointing to Replication on the Tools menu, and then clicking Create Replica.
  6. Close the Design Master.
  7. Open the replica.
  8. Open the form in Design view.
  9. Click Yes in the message that you receive when you try to open the form in Design view.
  10. Add a command button to the form.
  11. 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:
    "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."

Modification Type:MajorLast Reviewed:9/25/2003
Keywords:kberrmsg kbnofix kbprb KB287443