I've a hunch this is a more simple than it appears to be.
SELECT DISTINCT Baseline.MDS, Count(Nz(Baseline.[Lesson Type])) AS CBI
FROM Baseline
GROUP BY Baseline.MDS, Baseline.[Lesson Type]
HAVING Baseline.[Lesson Type] = 4
ORDER BY Baseline.MDS;
Also if you're using Nz([field]) then placeing...