MS Access – Bug – VBA Code Doesn’t Run as ACCDE

Software Bug

A quick post today to regarding a bug I’ve seen reported a few times (one thread is provided below as an example) in which a database runs fine as an accdb file, but once converted to accde the VBA will not run.

Obviously, the first thing required is to ensure the front-end file has a Trusted Location defined, but in this case, that is already done, yet the VBA code still would not run. As it turns out, the solution was to do some VBA spring cleaning and delete any and all empty procedures.

Stuff like

Private Sub Form_Load()

End Sub

needs to be purged.

So if you have any procedures you started, but never added content to, delete them all. Once your project is purged of such procedures, create a new accde and try again, it should run smoothly.

Hopefully this will help someone figure out why things aren’t working.

10 responses on “MS Access – Bug – VBA Code Doesn’t Run as ACCDE

  1. Daniel

    I often get this problem, and my experience is that I forgot to open the source code and manually running Debug -> Compile.
    At times the compiler will highlight an issue, other times the process will complete and the accde file will be created and running without an issue.

  2. Anders Ebro

    I’ve found in later versions of access (atleast since 2010) that if you do a debug>compile from the menu, those code stubs are removed for you. (if they match an event).

  3. Lee

    Amazing info, this just helped me solve an issue I’ve been working around for months. Thanks Daniel!

  4. PhilS

    Thank you! – I’m still speechless. – I encountered the very same problem today and there was indeed an Empty Form_Load event procedure causing this.

  5. Hovic

    It works. I had the same issue and removed the empty sub functions and it works perfectly.

    Thank you for your input.

  6. Tzivia

    Oh, wow…. what a stupid, stupid “feature.” Thank you so much for the tip-off, as I was having this EXACT problem!!!

    1. Daniel Pineault Post author

      The more you work with any program, and most certainly Access, the more WOW moments you will experience and you’ll often ask yourself what were they thinking to come up with this idea!

      I call all this type of stuff, and much more, ‘Microsoftisms’!