title: Select and count Query in VBA (Access 2010)
body: <p>I have a select query as part of an on_click event within a form.</p>
  
  <pre><code>varSQL2 = "SELECT DISTINCT(*), count(*) AS Count1" &amp; _
            " FROM Inventory WHERE Part_ID='" &amp; rs!Part_ID &amp; "';"
  </code></pre>
  
  <p>I am wondering what the correct syntax for this query would be. I would like all records that match the ID and then a count of how many there are. Is this syntax correct?</p>
  
  <p>It may be found that this is the correct syntax, however, I am neither getting an error nor response. </p>
  
  <p>Can anyone suggest a better alternative. I have seen cases where a subquery has been used, but I don't really understand the difference between that and what I have used.</p>