title: update query with inner join access vba code
body: <p>I am trying to update a table from another one via a inner join query access vba. The field's name to be updated will be taken in a form.</p>
  
  <p>I wrote this query, but it gives me error. </p>
  
  <pre><code>Dim dbs As Database
  Dim qdf As QueryDef
  
  Set dbs = OpenDatabase("Dba_Savings.mdb")
  dbs.Execute " UPDATE TblClient INNER JOIN TblImport ON TblClient.Account_Id = TblImport.Account_Id" _
  &amp; " SET TblClient." &amp; Me.txtNewFieldName &amp; " = TblImport." &amp; Me.txtNewFieldName2 &amp; ";"
  
  dbs.Close
  </code></pre>
  
  <p>Can anyone help me please.</p>
  
  <hr>
  
  <pre><code> Dim S As String
  S = "UPDATE TblClient INNER JOIN TblImport ON TblClient.Account_Id = TblImport.Account_Id" _
      &amp; " SET TblClient." &amp; Me.txtNewFieldName &amp; " = TblImport." &amp; Me.txtNewFieldName2 &amp; ";"
  Debug.Print S
  dbs.Execute S
  
  UPDATE TblClient INNER JOIN TblImport ON TblClient.Account_Id = TblImport.Account_Id SET TblClient.S_B_Mar-14 = TblImport.S_B_Mar-14;
  </code></pre>
  
  <p>The SQL work perfectly and update the table, No error.</p>