title: SQL Access VBA UPDATE table with another table? Too Few Parameters
body: <p>I am looking to update one of my tables with another table depending on a field condition. I am wondering what the correct way to do this is. I tried to do UPDATE statements with the 2 tables, but everytime it came out with this error: Too few Parameters, Expected 2</p>
  
  <p>My goal:
  If SOURCING field = O, I want Zip Code to be Origin Postal Code
  If SOURCING field = D, I want Zip Code to be Dest Postal Code</p>
  
  <p>So as of right now, I am simply doing a LEFT JOIN with a condition. Is this the best way to do it? Or should I have done this with the original INSERT statement somehow?</p>
  
  <pre><code>CurrentDb.Execute "UPDATE Processing" &amp; _
  " LEFT JOIN tblImport" &amp; _
  " ON Processing.[BATCH_NO] = tblImport.[BATCH_NO]" &amp; _
  " SET Processing.[Zip Code] = tblImport.[Origin Postal Code]" &amp; _
  " WHERE tblImport.[Sourcing] = O;"
  
  CurrentDb.Execute "UPDATE Processing" &amp; _
  " LEFT JOIN tblImport" &amp; _
  " ON Processing.[BATCH_NO] = tblImport.[BATCH_NO]" &amp; _
  " SET Processing.[Zip Code] = tblImport.[Dest Postal Code]" &amp; _
  " WHERE tblImport.[Sourcing] = D;"
  </code></pre>
  
  <p>I have tried changing the WHERE statement since I am not sure if it should be in quotes, single quotes, not in quotes, etc... but I have come up empty there. Everything else looks correct to me.</p>