b1kerch1ck
Programmer
I have a DCount problem that is driving me crazy. I have searched the posts and can't find anyone with the same problem.
I am building a query based on a table called tblRegItem. I want to count items based on itemNumber.
If I enter:
DCount("[itemNumber]","tblRegItem","[itemNumber] = 1")
...the query returns a count of 1, which is correct.
If I enter:
DCount("[itemNumber]","tblRegItem","[itemNumber] = 18")
...the query returns a count of 6, which is also correct.
If I try to do a DCount 'this or that', ie:
DCount("[itemNumber]","tblRegItem",("[itemNumber] = 1" Or "[itemNumber] = 18"))
...the query returns a count of 75, the number of records in the entire table.
I have tried variations on syntax, ie adding/removing parentheses, to no effect.
I'm pretty sure I've used this same DCount query successfully in the recent past, without problem.
Can anyone tell me what I am doing wrong?!?!?!
Thanks.
I am building a query based on a table called tblRegItem. I want to count items based on itemNumber.
If I enter:
DCount("[itemNumber]","tblRegItem","[itemNumber] = 1")
...the query returns a count of 1, which is correct.
If I enter:
DCount("[itemNumber]","tblRegItem","[itemNumber] = 18")
...the query returns a count of 6, which is also correct.
If I try to do a DCount 'this or that', ie:
DCount("[itemNumber]","tblRegItem",("[itemNumber] = 1" Or "[itemNumber] = 18"))
...the query returns a count of 75, the number of records in the entire table.
I have tried variations on syntax, ie adding/removing parentheses, to no effect.
I'm pretty sure I've used this same DCount query successfully in the recent past, without problem.
Can anyone tell me what I am doing wrong?!?!?!
Thanks.