title: Nested And/Or in VBA SQL query
body: <p>I have an Access UDA that uses some VBA/SQL code that I put together a long time ago and someone has recently asked me to adjust a particular query to exclude two criteria.  I thought I could simply add a SQL AND OR statement but I've been hitting quite a bit of trouble trying to get this simple fix to work.</p>
  
  <p>My original code:</p>
  
  <pre><code>SELECT * FROM [Master List] 
  WHERE ([Master List].IB)='" &amp; strIBTO &amp; "' AND ([Master List].[Type])&lt;&gt;'N'"
  </code></pre>
  
  <p>This correctly returns the results of the specific passed variable "strIBTO" that does not include Type = "N". </p>
  
  <p>Essentially the ask is to also exclude another Type from the query, so I modified the code:</p>
  
  <pre><code>SELECT * FROM [Master List] 
  WHERE ([Master List].IB)='" &amp; strIBTO &amp; "' AND ([Master List].[Type])&lt;&gt;'N' OR ([Master List].[Type])&lt;&gt;'T'" 
  </code></pre>
  
  <p>Now it seems like Access is throwing out my entire AND statement, as I am getting results with both "N" and "T" in them.  Tried various permutations with parenthesis enclosing the entire AND statement and inside as well but can't get the right results.</p>
  
  <p>Is VBA SQL different in nesting AND/OR from MySQL?  What am I doing wrong?</p>