Solved DCOUNT() ISSUE

I tried following and it is producing following errors.

X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & " ' " And AssigneeActive Is Null) = False '")
Run-time error 424 - Object Required

X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & " ' " And "AssigneeActive = 0")
Run-time error '13' - Type mismatch
 
Code:
X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & " ' " And AssigneeActive Is Null) = False '")
                                                                                       ^  ^                           ^     ^   ^
                                                                                       |  |                           |     |   |
                                                                       Remove this space  |       No matching open bracket  |   |
                                                                                          |                               Why?  |
                                                                                This double quote causes error                  |
                                                                                                             unmatched, unnecessary
                                                                                                            
X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & "' And (AssigneeActive = False OR AssigneeActive Is Null)")
 
the field AssigneeActive is Yes/No datatype.
it Cannot be Null, and the Default if not checked is No/False.
 
Code:
X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & " ' " And AssigneeActive Is Null) = False '")
                                                                                       ^  ^                           ^     ^   ^
                                                                                       |  |                           |     |   |
                                                                       Remove this space  |       No matching open bracket  |   |
                                                                                          |                               Why?  |
                                                                                This double quote causes error                  |
                                                                                                             unmatched, unnecessary
                                                                                                           
X = DCount("*", "T_ProjAssigneeDetails", "ProjNum = '" & Me!CboSearchProj.Column(0) & "' And (AssigneeActive = False OR AssigneeActive Is Null)")
Thanks Cheekybuddah,

Yes, it is working. Only thing is I need Not Is Null with second criteria.
 
the field AssigneeActive is Yes/No datatype.
it Cannot be Null, and the Default if not checked is No/False.
Excellent point Arnel,

I changed just now to not null and by default value to ZERO
 

Users who are viewing this thread

Back
Top Bottom