title: Is there a way to pass parameters through an update query to a select query in Microsoft Access VBA using the execute command?
body: <p>I'm trying to use the Execute command in Access VBA code to run a saved update query (that changes some information in a select query) but I keep getting: "Runtime Error 3061 - Too few parameters, expected 3".</p>
  
  <p>The update query has no criteria but the select query that it is editing does have a few criteria that are based on some TempVars.
  Here is the first criteria the select query uses:</p>
  
  <p><code>Like IIf([TempVars]![VarAccessLevel] Between 3 And 4,"*",[TempVars]![VarLoginID])</code></p>
  
  <p>The second criteria used is:
  <code>[TempVars]![VarClassBlockChosen]</code></p>
  
  <p>I'm assuming the TempVars are the 3 parameters it is looking for, but I have no clue how to go about providing them.</p>
  
  <p>Here is the VBA code I have written.</p>
  
  <p><code>CurrentDb.Execute "qupdMarkAllAsPresent", dbFailOnError</code></p>
  
  <p>Notably, I started out with <code>Do.Cmd OpenQuery "qupdMarkAllAsPresent"</code> and it worked fine but after I attempted to switch to the Execute command (to prevent warning messages) it began asking for parameters.</p>