title: Use a VB variable in a SQL statement
body: <p>I'm trying to create a sql statement but I require the use of a VB variable. The problem is, I keep getting an error about too few parameters when I try to just put the variable in. Is there some sort of format I need to use in order to add a VB variable into a SQL statement?</p>
  
  <pre><code>Set rs = CurrentDb.OpenRecordset("SELECT StartTime " &amp; _
              "FROM tblLunchTime " &amp; _
              "WHERE TimeID = (SELECT max(TimeID-count) FROM tblLunchTime);")
  </code></pre>
  
  <p>The variable in this situation is 'count'.</p>