So, I discovered today that Access2007 sets Sandbox Mode to On by Default!
I kept getting an #Error message for a text control on a report. The controlsource of the report looked-up the Caption of a tabcontrol page on a form. When I took the expression and ran it from the immediate window, I got a pop-up error that said something to the effect that “pages was an unsafe expression that was blocked by sandbox mode”!
Give me a break! What other unsafe expressions will they block next? Perhaps Backcolor?
So, I set sandbox mode off and didn’t get the error anymore. You need to use regedit, and select HKEY_LOCAL_MACHINE, then navigate to this key:
SoftwareMicrosoftOffice12.0Access Connecivity EngineEngines
Once you click on “Engines”, you should see SandboxMode in right pane. Double-click it and change the value from 3 to 2.