title: And/Or combination in VBA
body: <p>I am confused on how 'and' 'or' statements work together.
  I am trying to make a (something Or something) statement work as part of an 'and' statement but cannot figure out the logic
  The problem is illustrated by the following two code blocks.
  The first one works fine..the second fails with Run time error 438: "Object doesn't support this property or method". The error refers to the "If j.Enabled..." line.
  In my opinion both should run..can anyone elaborate on why this isn't so?</p>
  
  <p>Code block 1 (runs)</p>
  
  <pre><code>Private Sub Fini_cbn_Click()
  Dim j As Control
  For Each j In Controls
      If j.Enabled = True And j.Tag = "4" Then
          If j.Value = "&lt;NA&gt;" Or j.Value = "" Then
              j.BackColor = &amp;HFFFF&amp;
              Else
              j.BackColor = &amp;H80000005
          End If
      End If
  Next j
  End Sub
  </code></pre>
  
  <p>Code block 2 (fails)</p>
  
  <pre><code>Private Sub Fini_cbn_Click()
  Dim j As Control
  For Each j In Controls
      If j.Enabled = True And j.Tag = "4" And (j.Value = "&lt;NA&gt;" Or j.Value = "") Then
          j.BackColor = &amp;HFFFF&amp;
          Else
          j.BackColor = &amp;H80000005
      End If
  Next j
  End Sub
  </code></pre>