Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compile error in hidden module.

Posted on 2001-09-17
7
Medium Priority
?
1,174 Views
Last Modified: 2012-08-13
Hi, I have a user who within Access 97 (SR-2) is trying to convert a database into MDE. When doing so it is reporting "Compile error in hidden module".  I've asked him to try a basic DB from scratch and it works fine.  He's exported elements from his database into another one and works fine upto a particular form.  When using the Database it works fine without reporting this error.  He has no hidden modules (as far as he's concerned and hasnt created one.  Any ideas?  Ta V much in advance,
Martin.
0
Comment
Question by:mrbud
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:cjswimmer
ID: 6487699
check out Dev Ashish's comments on this problem at:

http://www.mvps.org/access/bugs/bugs0020.htm
0
 
LVL 6

Accepted Solution

by:
cjswimmer earned 405 total points
ID: 6487701
here is the text from that article:

---Originally Posted by Dev Ashish---
Bugs: Compile Error in Hidden Module
    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.
0
 
LVL 58
ID: 6487709
It's probably references. Open a module in design view, click tools/references. Note if any are listed as "Missing" or "Broken".  If so, you'll need to figure out why.

If not, uncheck one reference (note which).  Close the MDB and Access.  Re-open and recheck the same reference.  Now do a compile all.  You should not get any errors.

Then attempt conversion to a MDE again.

Jim.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:mrbud
ID: 6487846
Right, I think I've resolved the problem however he needs to do some work.  I'm sorry 'Guys', your suggestions didnt come up with anything(Correct me if i'm wrong).  
What Jim's suggestion did however was to point me to compiling within the module itself which guided me to a 'fix' (I hope, fingers crossed).
I remembered somewhere along the line, when buttons, etc are removed from within a form, the coding is sometimes left behind.  So what is hopefully happening here is, when it tries to compile the code it is pointing to missing objects, such as buttons, fields, etc. (hence, "hidden"!).
So, when he did a compile module, it said variable not defined.  
So this is why it worked without actually compiling the modules, just using the database & why it fails when having to compile the module to convert a MDE.
Sorry to waffle.  Any suggestions who to give the points to or should I keep them... let me know,, i'm reasonable.
I await his call back. (He's going to have to trudge through his code now to find the missing objects!)

Martin.
0
 
LVL 58
ID: 6488019
CJ was closest overall.  The whole issues revolves around the fact that the MDB wasn't in a compiled state to start and when converted to MDE, had errors in it.

For future reference, this is the #1 mistake made when creating MDE's.  Always make sure the code can compile before trying to create a MDE.  Do this even if it's been OK before and you'll avoid a lot of problems.

Jim.
0
 

Author Comment

by:mrbud
ID: 6488039
Ok, A true Gent Jim for suggesting CJ gets the points.  A worthwhile link as well.  Thanks a lot,
Martin
0
 
LVL 6

Expert Comment

by:cjswimmer
ID: 6488051
Thanks JDettman, very kind of you.  Thank you too mrbud, I'm glad you're problem is resolved.  
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question