title: Error: too few Parameters. Expected 3...while executing SQL statement in Access
body: <p>I've done this before, just a test as to whether a record already exists in a table before I insert a new record.  This was basically what I did, yet this time I get an error</p>
  
  <pre><code>Error: "3061 Too few parameters. Expected 2."
  </code></pre>
  
  <p>I tried to be very specific (<code>tblfromICPMS.Woid</code> instead of just <code>Woid</code>) thinking that might help, but it didn't really make a difference.  I get the specifically at the line </p>
  
  <pre><code>If rs.RecordCount = 0 Then
  </code></pre>
  
  <p>This is the code, where ThisWoid, Analyte and ThisTestId are local variables: </p>
  
  <pre><code>DIM rs As Object
  strSQL = "SELECT tblfromICPMS.Woid, tblfromICPMS.Analyte, tblfromICPMS.TestID FROM tblFROMICPMS WHERE (tblFROMICPMS.woid = " &amp; ThisWoid &amp; ") AND (tblFROMICPMS.analyte = " &amp; Analyte &amp; ") AND (tblfromICPMS.Testid=" &amp; ThisTestID &amp; ") "
  Set rs = CurrentDb.OpenRecordset(strSQL)
  If rs.RecordCount = 0 Then
     "insert record"
  End IF 
  </code></pre>
  
  <p><strong>UPDATE:</strong> error message changed to 1 expected after updating sqlstr in comments, also included declaration of rs.  For clarification tblFromICPMS is a table which contains the columns Woid, Analyte and TestId.  I have retrieved three values and stored them in local variables ThisWoid, Analyte and ThisTestId.  I want to insert a record but first I must see if it already exists in tblfromICPMS.  Also ThisWoid and Analyte are strings  </p>