title: DoCmd.OutputTo On Report Doesn't Unload
body: <p>In Access 2007, I have a form set up to allow previewing and exporting options for the project's reports.</p>
  
  <p>DoCmd.OutputTo seems to behave strangely when dealing with reports that have the Modal property set to true. Modal is currently set to True in the Open event for all of the reports that I'm working with.</p>
  
  <p>If I do<br/></p>
  
  <pre><code>DoCmd.OpenReport szReportName, acViewPreview
  DoCmd.Close acReport, szReportName</code></pre>
  
  <p>Then, focus and control is returned to the executing form normally.</p>
  
  <p>If I export directly instead and use <br/></p>
  
  <pre><code>DoCmd.OutputTo acOutputReport, szReportName</code></pre>
  
  <p>Then, the report is exported correctly, but control never returns to the executing form. It's completely disabled. The same code works just fine, if I use Modal = False when opening the report instead. I experimented a little with the report's event hooks to try and figure out what the difference is and <code>OnUnload</code> is never hit after <code>OutputTo</code> is called.</p>
  
  <p><br/></p>
  
  <p>I know I could work around this by only making the report modal when I need it to be modal, but it's definitely easiest to do from inside the report's code instead of the module opening it and I really don't think I should be having this problem. I also have no problem exporting the report from preview mode instead of directly from VBA, but apparently the customer does...</p>
  
  <p>So, actual questions:</p>
  
  <ol>
  <li>Is there any good reason for OutputTo to not trigger the Unload event? If this is normal behavior, then fine, but I would at least like to understand the reason for it.</li>
  <li>Is there any way to export a modal report and still regain control of the other windows? Or at least, a non-hacky way to re-enable and give focus to the calling form?</li>
  </ol>