title: VBA Error trying to set QueryDefs parameters for a query in access
body: <p>I have this qry in access, if I go into its design it has a criteria (which as I understand it is a parameter).</p>
  
  <p>The Report this qry is based off of works great, click on it a little thing pops up asks the required info and off it goes.  In code I am trying to do this and get a</p>
  
  <pre><code>Run-time error '424'
  Object Required
  </code></pre>
  
  <p>the offending line:</p>
  
  <pre><code> qdf.Parameters("Insurance Name").Value = inputStr
  </code></pre>
  
  <p>Lines before it:</p>
  
  <pre><code>Set qfd = CurrentDb.QueryDefs("qryInsGrpRoster")
  
   Dim inputStr As String
   inputStr = InputBox("Enter Insurance")
   'Supply the parameter value
   qdf.Parameters("Insurance Name").Value = inputStr
  </code></pre>
  
  <p><code>inputStr</code> definitely equals the value, it fails though.</p>
  
  <p>The criteria line in the qry is:</p>
  
  <pre><code>Like "*" &amp; [Insurance Name] &amp; "*"
  </code></pre>
  
  <p>Do I need the likes and all that to set that parameter?  </p>