title: Access VBA: Get difference in value between current and previous record
body: <p>I have made report based on query according to this link:</p>
  
  <p><a href="http://www.techonthenet.com/access/queries/max_query2.php" rel="nofollow">http://www.techonthenet.com/access/queries/max_query2.php</a></p>
  
  <p>It gives me list of records with values:</p>
  
  <p>(primaryKey)<br>
  ID.......FirstNum....SecNum.....Diameter.....Owner<br>
  1........100200.......01...............150..............Peter<br>
  2........100200.......02...............138..............Peter<br> 
  3........100300.......07...............112..............John<br></p>
  
  <p>Query sorts records in descending order by Diametral. I want make new column which will count difference between first and second record, then between third and second and so on. Like this:</p>
  
  <p>(primaryKey)<br>
  ID.......FirstNum....SecNum.....Diameter.....DiffDiametral.....Owner<br>
  1........100200.......01...............150.......................................Peter<br>
  2........100200.......02...............138.............12......................Peter<br> 
  3........100300.......07...............112.............26.....................John<br></p>
  
  <p>What should I write into RowSource or DataSource for DiffDiametral to get these values? How can I avoid error for first line, where is not previous value which I want substract from?</p>
  
  <p>I tried to solve it according to this link:
  <a href="http://support.microsoft.com/kb/101081/en-us" rel="nofollow">http://support.microsoft.com/kb/101081/en-us</a>
  but I did not solve it. Simply I dont know how I can refer previous value of Diameter to count difference.</p>