DCount Help - Code Inserted

matthewnsarah07

Registered User.
Local time
Today, 07:53
Joined
Feb 19, 2008
Messages
192
I am using the following DCount which works fine until I add the last bit
[QuestionCategoryID] = '1' this throws up a Data Mismatch - [QuestionCategoryID] is a Number field

Code:
Me.CH = DCount("ResponseID", "tblResponses", "[StaffID]=[TOID] And [CheckPeriod]= [CheckPeriod] And [QuestionResponse]= 'YES' And [QuestionCategoryID]= '1'")

Also in the [QuestionResponse] ='Yes' - this works fine but I want Yes or No - when I add the no it just counts all

Thank for any help
 
Remove the quotes around the 1. When you use quotes, it thinks that it's text.
 
Take the quotes off of the number 1. You only put quotes if the data is text.
 

Users who are viewing this thread

Back
Top Bottom