title: Generate a report off of a query in Access using VBA
body: <p>I am using Microsoft Access. I have a SQL Query. <code>Select * from people</code> </p>
  
  <p>I have current code which is hooked to a form button. How could I fix my code to properly generate a report?</p>
  
  <pre><code>DoCmd.OpenQuery "PeopleSearch", acViewPreview 'open query
  DoCmd.SelectObject acQuery, "PeopleSearch" 
  RunCommand acGenerateReport
  </code></pre>