Mar 03 2020 09:28 AM
I am trying to open an application that works with Access and I keep receiving an error code that says: There was an error compiling this function. The visual basic module contains a syntax error. Check the code, and then recompile it.
When I click ok, another message box opens for Macro Single Step.
How do I fix this issue?
Mar 03 2020 03:00 PM
There is an error in your VBA "somewhere". You must find it and fix it.
Start by opening the accdb with the SHIFT key held down (so-called "Shift bypass"). That bypasses any code running on the AutoExec macro when the accdb opens normally, or any code in any forms that open when the accdb opens normally.
Now, open the VBA IDE.
Make sure that EVERY module has these directives.
Next, go to Compile on the Debug menu.
This will force the VBA to compile and it will reveal the bad syntax in one or more procedures in one or more modules. Fix the syntax error(s) and recompile until the errors no longer cause compile to fail.
Save and restart.
By the way, one should ALWAYS have these two directives in EVERY module. Option explicit will save you many hours of head-scratching as you try to find syntax errors.