Share via

Access Runtime does not execute VBA code

Anonymous
2017-10-22T01:05:10+00:00
favorite I have been developing an Access database with VBA code for a few months and it has been working fine, until last week. The last night it worked, I added some code I found online to "bypass the bypass" (#3 at<br>http://www.techrepublic.com/blog/10-things/10-tips-for-securing-a-microsoft-access-database/). I went into and out of my database a few times, no problem.<br><br><br><br>   I shut down the laptop, but the next morning, when I pressed any of the command buttons, none of the VBA code would execute. I tried multiple previously saved copies of the database, none of the buttons work. I even tried a couple of different databases,<br> no buttons work. But when my coworker tried my original database, it works fine.<br><br><br><br>   I have recompiled, compact and repair the database and my IT department has uninstalled and reinstalled MS-Access, but no change in symptoms. I am stumped. I am running Access 2010 (32 bit) and Windows 7 Professional.<br><br><br><br>   So, I commented out the "bypass the bypass" code I copied from the link above (the last code added before this issue showed up), then created a brand new database, imported all of the tables, data, queries, forms and modules. The VBA code worked. I pressed<br> the buttons and they worked as expected. The code needed to be compiled, and it still worked after compiling. But once I performed a compact/repair, and the database closed, when I reopened it, the buttons did not work.<br><br><br>   Any help would be appreciated. Thanks.
Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-10-22T06:28:33+00:00

Sounds like your database is longer in a Trusted Location.  I would check that and see if that resolves your problem.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-10-24T05:12:02+00:00

    Glad that worked!

    Did you change it's location?  Other than that the only thing that comes to mind is something you *tried* the night before rest something and set you back to default which removed your set Trusted Locations.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-10-24T01:49:17+00:00

    Thank you for the suggestion. I read Gina Whipp's suggestion first and tried it and it worked. But I did Google "decompile" and bookmarked the web page that described it. I had never even heard of a decompile, so your suggestion did teach me something and I can use all the tools I can learn.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-10-24T01:35:59+00:00

    Thank you very much. I followed your suggestion and it did fix my problem. My VBA code works again. I don't know what I did or if I caused this. How does my database lose its trusted location? I know I didn't change this.

    Was this answer helpful?

    0 comments No comments
  4. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2017-10-22T20:22:05+00:00

    That, or perhaps a Decompile.

    Was this answer helpful?

    0 comments No comments