title: If [ComboBox] Is Null Statement in VBA/Access 2007
body: <p>I have a form with one ComboBox (<code>YearToBeBuilt</code>) and two textBox fields (<code>Cost</code> and <code>YearofExpenditureCost</code>). All controls are linked to a main table and the table is updated once the selections/entries have been made on the form.</p>
  
  <p>I have written a procedure in VB called <code>ReCalcIt()</code>which performs the following procedure when called: </p>
  
  <pre><code>Private Sub ReCalcIt()
  If Me.YearToBeBuilt = "" Then
      Me.YearofExpenditureCost = Me.Cost
  Else
      Me.YearofExpenditureCost = Me.Cost * (1 + 0.031) ^ (Me.YearToBeBuilt - 2010)
  End If
  End Sub
  </code></pre>
  
  <p>When I wrote this <em>I thought</em> that this would do the following:</p>
  
  <p>If the ComboBox <code>[YearToBeBuilt]</code> is blank (e.g.-no selection made) then
  the textbox <code>[YearOfExpenditureCost]</code> will return the value of the TextBox <code>[Cost]</code>.  Else, the calculation for <code>YearofExpenditureCost</code> is performed.</p>
  
  <p><em>But this is not working the way it should</em></p>
  
  <p>What am I doing wrong?  I am a VBA n00b so perhaps my syntax is incorrect?</p>