This can be done siimply with the addition of a couple of fields. I've attached a sample that calculates the averaeg cost and the stock value. You'll need to modify your purchase file script to show quantity on purchase on the stock record and probaly create a Receipt table to store your historical data.
Hope this helps
stock.zip 9.4 K