Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Bugs: Compile Error in Hidden Module

Author(s)
Dev Ashish
  This strange problem seems to have different origins and multiple solutions.  Some of the cases where I've seen (not personally) this error message come up:
  • only on one machine with, but not on another, when issuing a "Compile and Save All Modules"
  • only on one machine with, but not on another, when opening a particular form, while a recompile works.
  • when making MDE files from the UI (most common)
  • only under runtime environment (not on development machine) or using /runtime option (second most common)
  • in Autoexec macro on a Access 2 -> 97 database
  • in replicated databases using /runtime option.

    The complete message is:

A protected module can't be displayed. This error has the following cause and solution:
There is a compilation error in the code of the specified module, but it can't be displayed because the project is protected. Unprotect the project, and then run the code again to view the error.

    There have been several alternatives suggested, all of them have worked in one or more cases.  I can only suggest going through each item suggested here till one of them fixes the problem.

  • If you have a subroutine or function named the same as a module, rename one of them and try again.
  • Decompile the database, and then import all the objects into a new database.
  • If the database is a converted Access 97 from version 2.0, uncheck DAO 2.5/3.5 Compatibility Library and select DAO 3.5x Library instead.   Recompile the database.
  • In few cases, this was caused by Missing References.
  • If you're using DAO methods such as CreateWorkspace, OpenDatabase, CommitTrans etc., for example,  DBEngine.CreateWorkspace, DBEngine.OpenDatabase, Workspaces(0).CommitTrans.

© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer