Hi,
This should be easy but....
I have a livestock register. For each animal in the database there is parent form which contains the basic detail and there is a sub form that stores the weight of the particular animal each time its weighed. What I'm trying to do is simply calculate the change in weight from one reading to the next and display that figure in a separate column on the sub form. I dont want to store the figure, I just want to calculate and display it on the fly. I'm just not sure how to go about referencing the weight value in the preceding row so I can do the calculation.
For example, in the sub form below I would like the "Weight gain" column to be populated with:
first record: 270.2, which is 270.2 - 0 rcd 1 - 0
second: 150.8, which is 421 - 270.2 rcd 2 - rcd 1
third: 14.5, which is 435.5 - 421 rcd 3 - rcd 2
I understand the first row would be anomaly that I would need to code around (Ie there is no preceding record) but I'm sure I can work around this once I have the method for doing rows 2 onwards.
Thanks in advance.