title: Crystal report with formula field
body: <p>I have a formula field (@stock) in my Crystal report, I want to put in this formula field  </p>
  
  <ul>
  <li><p>Initial value = {Stock.ActualStock}</p></li>
  <li><p>{Stock.ActualStock} when {Delivry.Quantity} is null.</p></li>
  <li><p>(@stock) - {Delivry.Quantity} when {Delivry.Quantity} is not null</p></li>
  </ul>
  
  <p>This is the code i tried:</p>
  
  <pre><code>    if IsNull({Delivry.Quantity}) Then
          formula = {Stock.ActualStock}
      Else
          formula = formula - {Delivry.Quantity}
      End If
  </code></pre>
  
  <p>But i get the vlue of {Delivry.Quantity} in (@stock) when {Delivry.Quantity} </p>
  
  <p>it is not null, and when it is null i get this error message:</p>
  
  <blockquote>
    <p>Ce nom de champs est inconnu.
    Erreur dans la formule de stock:
    if IsNull({Delivry.Quantity}) Then</p>
  </blockquote>
  
  <p>So how can i get the values i want in this formula field??</p>
  
  <p>Thanks in advance.</p>