title: accde ran using runtime stops any code from executing
body: <p>I've upgraded an old access 2003 database to access 2010. The original database was split with an access front (installed to the clients) and back end (residing on the server). The new database uses access for the front end but the back end has been moved to SQL server.</p>
  
  <p>Once it was finished I created an accde file and packaged that up in an installer to distribute it to all the client pcs. The installer creates a desktop shortcut that runs access 2010 in runtime mode and starts the front end database.</p>
  
  <p>I tested it locally and on my development PC everything is fine. But on a test client pc (with Office 2010 installed) it gives an error upon opening the database that stops all code being executed. This is obviously a pretty major error and stops anyone from using the database.</p>
  
  <p>The error is</p>
  
  <pre><code>The expression On Current you entered has the event property setting produced the following error
  The expression may not result in the name of a macro, the name of a user defiend function, or event procedure.
  </code></pre>
  
  <p>I have ensured that the database is in a trusted location and tried it with all macros enabled but still get the same error. Before creating the accde I have also ensured that all the code compiles.</p>
  
  <p>I've manually copied the accde file across on a clean test pc to check if it was a problem with the installer and even opening the accde in full access (ie not using the /runtime flag) gives the same error. If I copy the accdb file to the client pc then it runs fine, but obviously distributing an accdb isnt a secure way of running the database.</p>
  
  <p>I've also tried creating a blank access 2010 db and importing all of the objects from the updated version (which was an mdb file that was converted to accdb) to check its not a problem with the way access converted the original mdb - still the same error.</p>
  
  <p>Has anyone come across this error before/can shed some light on it for me, I'm well and truely stumped.</p>
  
  <p>EDIT: After playing around on the test client pc I've noticed that if i open the accdb file and then save it as a accde, overwriting the installed version, then it will work fine. but this obviously adds a massive over head to installation to all the clients and removes the ability to automate it. so its not really a viable solution in itself... hopefully it points someone in the right direction.</p>
  
  <p>EDIT2: I've also checked and confirmed that all the references are intact ie dll/ocx/etc and present on the test client pc</p>