Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Code execution stops working after converting to MDE

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
I have a database front end that I have been using for several years without issue.  I have always had no issue converting it to an MDE file and having all the VBA code work correctly.

After a long day of work on the Front end today I attempted to convert the database to an MDE file and found that none of the VBA code was working any more on the MDE version of the database.  This is only a problem after converting to an MDE file.  The MDB version works perfectly fine.

The following is what I have attempted to do to resolve this:
I attempted setting macro security to the lowest level.
I did a compact and repair on the MDB file.
I tested on multiple PC's, both the MDE files and converting the MDB to a MDE file.

Any advice would be appreciated.
Question by:alcoahd
  • 2
  • 2
LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 35725153
Not much to go on here, but ... try the procedure below on the MDB version.  If no issues, convert to MDE and see what happens.

A **DeCompile** may help here ...

But first, if you have not already:
Open the VBA Editor and from the menu ...Tools>>References ....
If you see any listed as **Missing: <reference name>, including the asterisks and the word Missing, the
you need to fix that first.

Then, follow this procedure:

0) **Backup your MDB BEFORE running this procedure**
1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
Close the mdb after the Compact & Repair.
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Close the mdb.
6) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

7) Close the mdb
8) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an **example** of the command line syntax  (be SURE to adjust your path and file name accordingly) before executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:
Also, the double quotes are required.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\YourMdbNameHERE.mdb"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:



Author Comment

ID: 35729062
Thanks, I realized on my way home that I left out a few key details.  Let me give this a try and if it doesn't work I'll try to clarify anything I may have missed.

Author Comment

ID: 35729428
It worked beautifully.  Thanks.  I had no missing references so the decompile/compile must have done the trick.  FYI this was an Access 2007 version Access on a 2003 MDB file.
LVL 75
ID: 35730656
I am very glad to hear this.  It's sort of a comprehensive procedure that is fixed many odd issues.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

569 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