title: VBA OpenRecordset Producing Too few parameters. Expected 2. Error
body: <p>I have a query called qryAlloc_Source that has two paramaters under one criteria:</p>
  
  <pre><code>&gt;=[forms]![frmReportingMain]![txtAllocStart] And &lt;=[forms]![frmReportingMain]![txtAllocEnd])
  </code></pre>
  
  <p>A have a separate query that ultimately references qryAlloc_Source (there are a couple queries in between), and that query runs fine when I double click it in the UI, but if I try to open it in VBA, I get an error.  My code is:</p>
  
  <pre><code>Dim rst As Recordset
  Set rst = CurrentDb.OpenRecordset("qryAlloc_Debits")
  </code></pre>
  
  <p>I am getting run-time error 3061, Too few parameters. Expected 2.  I've read that I may need to build out the SQL in VBA using the form parameters, but it would be pretty complex SQL given that there are a few queries in the chain.</p>
  
  <p>Any suggestions as to a workaround?  I considered using VBA to create a table from the query and then just referencing that table--I hate to make extra steps though.</p>