What is your code for the DCOUNT function?
Re-read the Help in Access for DCOUNT. Check out the example.
For the textbox Control Source property:
=DCOUNT("[TheField]","TheTable","[MyField] = somevalue")
If you're looking for a variable for somevalue, then substitute "[MyField] = somevalue" with "[MyField] = " & me.variablevalue