I am creating a customer db with a stock ordering capability. I wish to create an inventory that updates based on stock sold. The order details table lists the numbers of each item that is sold but I need to be able to group similar items from different orders, total the sales and then deduct the result from the on hand figure to create a new on hand. Basically a spreadsheet function. Can any one suggest how I can go about this please.