title: VBA won't compile? "Error Accessing the system Registry"
body: <p>I was working on a Form and then Access crashed. When I tried to open it, I was prompted with an error which I didn't recognize how to fix right away. Something like </p>
  
  <blockquote>
    <p>Form1 doesn't exist , if the invalid form name is in a macro ...</p>
  </blockquote>
  
  <p>At the time, I couldn't figure it out, so I hit "Compact and Repair", closed and re-opened access a few times. Then there was another message, don't exactly remember but soemhting like "To continue, all VBA code must be deleted."  I said Ok, because I have a few back up copies.  But that didn't fix anything.  </p>
  
  <p>Then I figured out how to fix the original error.  "Form1" was my default form to open on startup, so I changed it. So everything works, I copy the code back in, but obviously the code doesn't work. The error message is:</p>
  
  <blockquote>
    <p>Compile Error user defined type</p>
  </blockquote>
  
  <p>on the DAO.QueryDef</p>
  
  <p>Then I follow MS Help and check the references, and when I click on Tools -> References, I get</p>
  
  <blockquote>
    <p>Error acessing the System Registry. </p>
  </blockquote>
  
  <p>So, any thoughts that include not messsing with the Registry?</p>