Please help with DCount Function

yanniper

New member
Local time
Tomorrow, 01:15
Joined
Jul 30, 2010
Messages
4
Hi
I need to count all fields with the status in the form base on Query with input value
For example "=DCount("[Status]","[MainQ]","[Status]=Work")" but I get an error message
What is the Problem with this syntax
For example Please see the attachment file , Type in the input box "ben" or "David" and click OK
Thank You
 

Attachments

Code:
=DCount("*","[MainQ]","[Status]=[B][COLOR=Red]'[/COLOR][/B]Work[COLOR=Red][B]'[/B][/COLOR]")
 
Thank you​
But the syntax doesn't work in my case, it work only if I change the Criteria in the Query from​
Like [name] & "*"[FONT=&quot]
[/FONT]​
to

"ben" for example
 
I used vbaInet code and it worked in your database. I have attached your database for you to check.
 

Attachments

Hi

I don't see the vbaInet code, the form show all records without input value for filter​
 
You will get all the records in my example as I removed the criteria for the user. You will need to somehow include the [name] in the dcount so that you can count on Status = Work AND Users = a selected user etc.
 

Users who are viewing this thread

Back
Top Bottom