title: VB6 - IIF (ISNULL(rs),"TRUE",Replace())
body: <p>why i cannot use :</p>
  
  <pre><code>     rep8_bc = IIf(IsNull(rs(8)), "null", Replace(rs(8), "'", "''"))
  </code></pre>
  
  <p>it say " Invalid use of Null"</p>
  
  <p>but if i remove replace, it's work. And then get error because record have an apostrophe character, so i change the code into this :</p>
  
  <pre><code> rep8_bc = "null"
   If IsNull(rs(8)) = False Then rep8_bc = Replace(rs(8), "'", "''")
  </code></pre>
  
  <p>or this :</p>
  
  <pre><code> If IsNull(rs(8)) = False Then
       rep8_bc = Replace(rs(8), "'", "''")
   else
       rep8_bc = "null"
   end if
  </code></pre>