Full Version: VBA code does not work
UtterAccess Forums > Microsoft® Access > Access Forms
I have a database that I use some standard VB code to view a list box, open a form, search records,print a record etc. Here is my problem:
Ocreated the database with Access 2003 everything works great, I converted this database to access 2007, when I run the database I get a security prompt that asking if I want to enable the code. I say yes enable this code. Everything works great again.
I then create an accde (runtime executable) and the code stops working again?
Any suggestions please.
Doug Steele
Welcome to UtterAccess.
Security is much tighter in Access 2007. To automatically enable VB code, the database file must exist in a trusted location. See Why are my macros and VBA code not working in Access 2007?. The "trick" in Using Access 2007 Runtime, how can I create a Trusted Location if there's no UI to create it? can also be used.
Sorry I should have mentioned this before, I did add my file location to the trusted list. now when I run the database in full edit mode it works without haveing to enable this code, but after I create the accde (excuteable) the none of the buttons work?
Doug Steele
Let's make sure I understand. You've set some folder (Let's call it "C:\MyFolder") as trusted, put your database ("MyDB.accdb") into that folder and everything works. You then convert MyDB.accdb to MyDB.accde, leave it in the same folder, and, on the same machine, things no longer work. I'm afraid I haven't seen that occur before.
You are exactly correct, and I agree this makes no since. I thought that the problem was with the security issue that is way I created the trusted directory. but that does not even help. Maybe its something I am doing when creating the accde. I will try to create another accde using another database project and see if it will work or not.
Thanks for your help.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.