Using DCOUNT in Access with multiple criteria


I have a database that tracks pupil progress with different subjects which are rated at different levels . I have a Y/N filed which indicates if the subject has been passed.  I have this written in the footer of the form

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE" AND " LCode=3 ")

If I run it with

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE" )

It tells me how many subjects have been passed but if I add the bit that asks  for those subjects with level (LCode) 3 that have been passed it just counts all the records my guess is i have some quotes in wrong place but cannot work it out ...

Any help appreciated.
Who is Participating?
Try this:

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE AND  LCode=3 ")
tmckeatingAuthor Commented:
Thanks you saved me hours of torture with spaces quotes and perfectly! Much appreciated.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.