VBA doesn't work in accde but does in accdb RRS feed

  • Question

  • Greetings,  I have vba code that works in my accdb but does not work in my accde.  I have: 

    1. compacted and repaired

    2. decompiled

    3. created a whole new db and imported all the objects, compiled to same area, and tried to run

    The accde will not perform the vba that is in the accdb.

    Wednesday, April 18, 2012 9:19 PM

All replies

  • Is it in a trusted location?

    What is your code?

    Chris Ward

    • Proposed as answer by KCDW Friday, June 20, 2014 6:58 PM
    Wednesday, April 18, 2012 9:28 PM
  • We need more details to be able to help you with this.

    Is it a small part of code that won't run - do you have any active-x controls which could give problems with references?

    Check that there are no problems with references in the accdb. 

    The way code was written using both DAO and ADO in a2007 was a problem for someone when trying to get the accde to run.

    Some people had a similar problem with A2007 - --"A 'quirk' with A2007 where you have to compile the VBA project immediately before creating the ACCDE."

    Jeanette Cunningham

    Wednesday, April 18, 2012 9:50 PM
  • Hi Liz

    Liz Ravenwood wrote:

    Greetings, I have vba code that works in my accdb but does not work in my
    accde. I have:

    Can you pls provide some more information? What version(s) of Access are involved?
    Are you using the full version to run the ACCDE or a runtime?
    Are you trying to run the ACCDE on the same machine/environment where you generated the ACCDE?


    Thursday, April 19, 2012 4:42 AM
  • Hi
    I had same problem but I solved by removing empty rustiness. Its very annoying that accdb does not give error message but the accde does. 

    I would like to share the solution with community 

    In my case there were some empty sub-routines in VBA which were causing the problem. Like below.
    Private Sub Form_Type_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Form_Load()

    End Sub

    When I removed them then I could make and run the accde successfully. 


    Muhammad Arshad Awan

    • Proposed as answer by vertonghen Wednesday, June 19, 2019 10:17 AM
    Wednesday, October 15, 2014 9:35 AM
  • I just wanted to chime in and say that I too had empty subs; when I removed them, my code worked!!

    Thank you for the great solution Muhammad! Microsoft really should fix this - it's bad!!!

    Wednesday, February 1, 2017 9:13 PM
  • Salam

    also I had the same issue and the fixed now

    thanks Muhammad :)

    Monday, April 24, 2017 10:47 AM
  • Thank you SO much!  I have been banging my head and searching for the solution.  Susan
    Thursday, June 29, 2017 9:50 PM
  • That is amazing, it worked! Thank you Arshad!!

    Also if you have nothing but comments in your sub, you have to remove those, too.

    Thursday, August 31, 2017 12:54 AM
  • Thanks
    Tuesday, February 6, 2018 5:32 AM
  • Muhammad Arshad Awan, GOD BLESS YOU!


    I was turning crazy 10 days long (and also a lot of my friends and collegues) 'cause this stupid Microsoft bug!

    Thank you again!

    Tuesday, April 17, 2018 8:09 PM
  • Muhammad Arshad Awan - Thankyou, thankyou, thankyou.  I haven't used Access for a few years and found myself struggling with this issue
    Tuesday, September 18, 2018 2:30 AM
  • If you are having trouble like this, the method for troubleshooting would be to turn on "Break on all errors" Removing some empty code blocks does not mean you have corrected the issue. As your db grows or ages the problems may re-occur. Better to completely diagnose rather than being satisfied that removing empty code blocks is the cure.

    Just takes a click to give thanks for a helpful post or answer.
    Please vote “Helpful” or Mark as “Answer” as appropriate.
    Chris Ward
    Microsoft Community Contributor 2012

    Tuesday, October 30, 2018 4:43 PM
  • Hi,

    Arshad Bhai you have very rightly pointed out the problem. Its very small but very confusing. It has resolved my problem after removing all blank events. Now ACCDE is working fine. Thanks once again. DIO, NIC INDIA

    Thursday, September 19, 2019 7:09 AM