title: if statment with var actual text
body: <p>I need a little help with Access VBA. 
  I need to define a variable in a form from user input and, depending on the choice, create an <code>If</code> statement with that var.</p>
  
  <p>Something like this:</p>
  
  <pre><code>'defining var
  if text.value = 12 then
  ST = "If Not HasValue(Forms!co.Theme) Or Not HasValue(Forms!co.cxlogin) Then"
  else
  ST = "If Not HasValue(Forms!co.message) Or Not HasValue(Forms!co.fone) Or Not HasValue(Forms!co.cxlogin) Then"
  end if
  </code></pre>
  
  <p>Then, in another form, call the var and "inject" the var in the statement...</p>
  
  <pre><code>ST            'here i like to have the actual text in the var so i can build the statement
  else
  end if 
  </code></pre>
  
  <p>The <code>HasValue</code> function is in a module and works well, also I declare the var <code>Public</code> so I can call it from any form I need to:</p>
  
  <pre><code>Option Compare Database
  public ST as string
  </code></pre>
  
  <p>Am I shooting the moon, or is it real easy and I just can't see it?</p>