Quick DCount Question

matthewnsarah07

Registered User.
Local time
Today, 00:21
Joined
Feb 19, 2008
Messages
192
Hi

Quick one

in a DCount criteria expression I want to count one field if it contains a Yes or No answer - its a text field not a Yes/No

I was trying [QuestionResponse] = 'Yes' or 'No'")

Any help on what I'm doing wrong
 
You would need to use:

"[QuestionResponse] = 'Yes' or [QuestionResponse] = 'No'")
 
Many thanks thats sorted it
 
Apologies should have mentioned there are multiple criteria as below, adding the or just bypasses the other criteria - what can i do?

Code:
Me.CH = DCount("ResponseID", "tblResponses", "[StaffID]=[TOID] And [CheckPeriod]= [CheckPeriod] And [QuestionCategoryID]= 1 And [QuestionResponse]= 'Yes' or [QuestionResponse]= 'No' ")
 
Add parentheses:

Me.CH = DCount("ResponseID", "tblResponses", "[StaffID]=[TOID] And [CheckPeriod]= [CheckPeriod] And [QuestionCategoryID]= 1 And ([QuestionResponse]= 'Yes' or [QuestionResponse]= 'No' "))
 

Users who are viewing this thread

Back
Top Bottom