Another Alternative
I had this same issue with a little twist. I thought I would go ahead and post for future reference to someone else. This site is so helpful to me I hardly ever get to actually contribute.
I have a tblRankTest. I created the following:
qryCountproduct
SELECT tblRankTest.VolunteerID, tblRankTest.ProductID, Count(tblRankTest.ProductID) AS CountOfProductID, tblRankTest.ProductDesc, Sum(tblRankTest.Charge) AS SumOfCharge
FROM tblRankTest
GROUP BY tblRankTest.VolunteerID, tblRankTest.ProductID, tblRankTest.ProductDesc
ORDER BY tblRankTest.VolunteerID, Count(tblRankTest.ProductID) DESC;
and this 2nd query which gets the top 4 within each product.
SELECT a.VolunteerID AS volunteerid, a.ProductID AS productid, DCount("*","qryCountProduct","[VolunteerID] & [ProductID] >= '" & [VolunteerID] & [ProductID] & " ' and [VolunteerID] = " & [VolunteerID]) AS [Top Ranking], a.ProductDesc, a.SumOfCharge
FROM qryCountProduct AS a
GROUP BY a.VolunteerID, a.ProductID, a.ProductDesc, a.SumOfCharge
HAVING (((DCount("*","qryCountProduct","[VolunteerID] & [ProductID] >= '" & [VolunteerID] & [ProductID] & " ' and [VolunteerID] = " & [VolunteerID]))<=4))
ORDER BY a.VolunteerID, a.ProductID DESC;
No third query is need because I incorporated it in the 2nd Query.
