I would like to know a method of looping through a recordset, and counting the number of times something occurs (in my case how many times a foriegn key occurs). I want to count each foriegn key though, not just one.
My foriegn key is called "vet id", the table is tblanimals.
So say I had three animals, two animals had a FK vet ID of 2 and the other animal had an FK Vet ID of 1 so my page would display a count of two for vet 2, and one for vet 1.
I am thinking that I need to capture each vet ID in a variable from it's origin table (tblvets) and then loop through each record in the animals table adding one to the variable count but I am not sure how to achieve this.
Thanks
My foriegn key is called "vet id", the table is tblanimals.
So say I had three animals, two animals had a FK vet ID of 2 and the other animal had an FK Vet ID of 1 so my page would display a count of two for vet 2, and one for vet 1.
I am thinking that I need to capture each vet ID in a variable from it's origin table (tblvets) and then loop through each record in the animals table adding one to the variable count but I am not sure how to achieve this.
Thanks