title: Simple Date Difference Referencing Form Control
body: <p>I am trying to do a simple date difference calculation that returns a Year and Month value. The code the I have now is:</p>
  
  <pre><code>Private Sub Form_AfterUpdate() 
  Dim IntegerYears As Long 
  Dim IntegerMonths As Long 
  
  IntegerYears = DateDiff("yyyy", Me.DeemedFilingDate, Now()) 
  IntegerMonths = DateDiff("m", Me.DeemedFilingDate - IntegerYears, Now()) 
  Me.TimeElapsedFromFilingDate = IntegerYears &amp; " Yr(s)." &amp; " " &amp; "," &amp; " " &amp; IntegerMonths &amp; " Mo(s)." 
  
  End Sub
  </code></pre>
  
  <p>At this point, I am getting an output in year/month format, but it's not correct. I am getting negative numbers, the month count goes above 12 months, and the year shows 1 year when the start date is in the previous year but a year hasn't necessarily passed. For instance, the code will return 1 year if the start date is 12/1/2017 and the current date is 3/2/2018 instead of just returning 3 months. </p>