I would build an aggregate query on qryStat with a special column to determine ifit has a FAIL:
SELECT Color, SUM(Iif(Result='FAIL', 1,0) AS Fails
GROUP BY Color
That will give you a record for each unique color and denotes how many fails each has.
That will be the query that feeds your 2 text boxes. You will set their control sources to DCount functions (https://www.techonthenet.com/access/...ain/dcount.php
txtBox1 will be a simple DCount using just the first 2 arguments.
txtBox2 will require you to use criteria to exclude those with a Fails field greater than 0
Give the above shot and post back any issues you encounter.