I'm creating a school database and on one form I want to be able to select a 'classid' (text value) from a combo box and have a text box next to it return the number of students, 'enrollmentid', in that class.
I'm using a table called 'enrollment table' as the source of the form.
The text box,'student count', used to return the count has:
=DCount("[classid]","Enrollment details","[classid] = '" & Me.[class select] & "'")
as its control source.
When I select a class from the combo box, 'class select', I get a #name error message in the 'student count' text box.
Any help would be greatly appreciated.
BTW, 'enrollmentid' and 'classid' are both on the 'many' side of relationship, and are primary keys.