Compile error in hidden module.

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.
mrbudAsked:
Who is Participating?
 
cjswimmerConnect With a Mentor Commented:
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
 
cjswimmerCommented:
check out Dev Ashish's comments on this problem at:

http://www.mvps.org/access/bugs/bugs0020.htm
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
mrbudAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
 
mrbudAuthor Commented:
Ok, A true Gent Jim for suggesting CJ gets the points.  A worthwhile link as well.  Thanks a lot,
Martin
0
 
cjswimmerCommented:
Thanks JDettman, very kind of you.  Thank you too mrbud, I'm glad you're problem is resolved.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.