I'm trying to make an MDE file; I'm getting an error message saying it can't
compile because of a hidden module. I don't remember hiding anything (don't
know how to either). How do I find it? It gives me the name of the form, but
that form doesn't show up in my database window.
Hi Frodo,
I've seen this before and 99% of the time there is some kind of VBA
corruption. Simply compacting does not always fix the issue because
the compiled version of the code can sometimes differ from the text
version you see. This can prevent the creation of an MDE file.
At this point I think a decompile is in order.
Here is an explanation of what it does by MVP Allen Browne:The Decompile switch was undocumented in earlier versions of Access, but has
been documented for 3 versions now.
Decompiling may not give the same results as importing into a new database.
In an mdb file, there are 2 copies of the code:
- a text version (what you view and edit);
- a compiled version (what actually runs).
If the database corrupts, these 2 may differ.
Decompiling discards the compiled version.
It then recreates the compiled code from the text version.
The inconsistency is then gone.
If you import from one mdb into a new file, using the same version, Access
may import both the text version and the compiled version exactly as they
were. If the two copies were inconsistent, the new version can therefore
still have the inconsistency. This is not common, but it does happen.
So, the safest procedure would be:
1. Decompile the old mdb.
2. Compact it to get rid of the space used by temp objects and the compiled
code.
3. Import into a new (blank) database. At this point you are importing only
the text version as the compiled version has been discarded.
4. Set your minimal references, and compile.
So to elaborate a little further here is what I would do.
1. Make a backup of your database.
2. Repeat step 1
3. Compact the database:
Tools | Database Utilities | Compact
4. Close Access. Open a command prompt, and enter something like this. It is one line, and include
the quotes:
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\My
Documents\MyDatabase.mdb"
Adjust the syntax for your Access.exe file and file location.
5. Compact the database again to clear it out:
Tools | Database Utilities | Compact
6. Create a new blank database and import everything (including data, menubars, toolbars,
relationships, etc.)
7. Set minimal References needed
8. Turn off Name AutoCorrect
9. Compile your new database
10. Compact the new database
Tools | Database Utilities | Compact
11. Set any Startup properties
Tools | Startup
12. Close the database (and Access) and then reopen
Try making an MDE file now.
Success??