 <p>I think you have a problem with quotes in your statement text. Look at this excerpt based on your code when I tested in the Immediate window:</p> <pre class="lang-sql prettyprint-override"><code>intYear = 2015 ? "WHERE [Market Segment]= 'CMS Part D (CY ' &amp; (intYear) &amp; ')'" WHERE [Market Segment]= 'CMS Part D (CY ' &amp; (intYear) &amp; ')' </code></pre> <p>That can't be right. And when Access tries to execute the query and sees <em>intYear</em>, it interprets that to be a parameter because the db engine knows nothing about a VBA variable named <em>intYear</em>.</p> <p>I think it should look like this:</p> <pre class="lang-sql prettyprint-override"><code>? "WHERE [Market Segment]= 'CMS Part D (CY " &amp; (intYear) &amp; ")'" WHERE [Market Segment]= 'CMS Part D (CY 2015)' </code></pre> <p>I encourage you to follow KevenDenen's advice to add <code>Debug.Print strCount2</code> to the code after it has finished building the <code>strCount2</code> string. Then you can run the code and view the text of the completed statement in the Immediate window. (You can use <kbd>Ctrl</kbd>+<kbd>g</kbd> to go to the Immediate window.) It helps tremendously to examine the actual statement your code is asking Access to execute.</p>