Counting values in different records based on a field
Sorry if this question has been raised before but I've just started using FM Pro and am kind of stuck on how to achieve the following.
Say I've got a Table called "Products" which has a field called "Barcode" (primary key). A second table is called "Purchases" which has the "Barcode" field from the "Products" table as a foreign key and a "Quantity" number field.
How would I go about creating a calculation field in the "Products" table to count / add up all the quantities for each record in the "Purchases" table based on the "Barcode"?
I'm using Filemaker Pro 11 with Mac OS X 10.6.8
Thanks in advance,