Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compile error in hidden module.

Posted on 2001-09-17
7
Medium Priority
?
1,183 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

916 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