From what I'm seeing, if the macro is a 'run code' macro, and if either 'macros are disabled' in the Trust Center Settings, or if 'macros are disabled' and the database is not in a trusted location, then the macro errors with '2001'.
I have VBA code locked from viewing with a password.
Hi. You're correct. When VBA is disabled, then macro calls to VBA will error out. So, what I was saying was test first if you can call VBA from your macro. If not, then get out; otherwise, continue on. I already told you how to test if VBA is disabled or not from a macro.
PS. I almost missed it... You just told us how you disable macros - through the Trust Center Settings. Unfortunately, I just gave it a try and selected "Disable all macros without notification," but my Autoexec macro still fired even when the file was in a non-trusted folder. So, I think what I was saying, to put a test for VBA availability from the Autoexec macro, should work and help you overcome some of your concerns. However, if the user uses the shift bypass, then all bets are off. This is a limitation of Access, and we all have to live with it. The only way around it is to only run your application in Runtime environments.