title: Optimize SQL query in VBA
body: <p>I am trying to find the most optimized way to do this operation which runs an SQL statement in Access-VBA :</p>
  
  <pre><code>SQl = "UPDATE " _
  &amp; "MainTable As T1 " _
  &amp; "INNER JOIN TableOfLists As T2 " _
  &amp; "ON (T2.SecondList = T1.MultiValuedList.value) " _
  &amp; "Set [FOUND IN LISTS] = 'YES' "
  DoCmd.RunSQL SQl
  
  SQl = "UPDATE " _
  &amp; "MainTable As T1 " _
  &amp; "INNER JOIN TableOfLists As T2 " _
  &amp; "ON (T2.FirstList = T1.MultiValuedList.value) " _
  &amp; "Set [FOUND IN LISTS] = 'YES' "
  DoCmd.RunSQL SQl
  </code></pre>
  
  <p>This code works, can be improved surely, but I didn't manage to find out how.</p>
  
  <p>What I've tried so far and the results I got :</p>
  
  <ol>
  <li><a href="https://i.stack.imgur.com/49yW0.png" rel="nofollow noreferrer">Adding 2 INNER JOIN </a> but I get a syntax error 3075 </li>
  <li><a href="https://i.stack.imgur.com/wtMEL.png" rel="nofollow noreferrer">Adding 2 conditions separated by an OR in the INNER JOIN condition</a> but I get an error 3081 : <em>can't join more than 1 table</em></li>
  <li><a href="https://i.stack.imgur.com/MPkPH.png" rel="nofollow noreferrer">This was my previous solution using 2 SELECT statements</a> but I
  got recommended to use JOIN instead</li>
  </ol>
  
  <p>Any suggestions welcomed !</p>