Code execution stops working after converting to MDE

Posted on 2011-05-09
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
    LVL 75

    Accepted Solution

    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 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:

    LVL 1

    Author Comment

    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.
    LVL 1

    Author Comment

    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

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    I am very glad to hear this.  It's sort of a comprehensive procedure that is fixed many odd issues.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    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 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…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now