Help! I'm not sure where to post this, so here goes. Is
it possible to use 'AND' in the criteria portion of a
dcount() function. Specifically, I want to count the
number of records that have a particular value in Field
A, and a particular string in Field B.
As an example:
Dcount("BusID","tblBusiness","[Rate]=2 AND [Department]=
Sales).
The idea here is to count only the number of records
where the Rate is 2, and the Department is "Sales".
Is there any hope?
Thanks for any help,
Curt
DCount("[BusID]","tblBusiness","[Rate] = 2 AND [Department] = ""Sales""")
or Access VBA Help shows the example like this:
DCount("[BusID]","tblBusiness","[Rate] = 2 AND [Department] = 'Sales'")
HTH,
Debbie
| Help! I'm not sure where to post this, so here goes. Is
| it possible to use 'AND' in the criteria portion of a
[quoted text clipped - 13 lines]
|
| Curt
Erice - 09 Mar 2005 23:07 GMT
I was able to get the mulitple criteria model to work, but what syntax in
invovled in getting a variable to affect the criteria?
Ex: LocCount = DCount("LocationCode", "Location", "'lnkCrit'")
lnkcrit = "[Location!projectID] = " & strProjID & ""
I'm trying to return the number of records on Location that match to a
particular project ID for a For... next loop.
Sincerely,
Eric
> DCount("[BusID]","tblBusiness","[Rate] = 2 AND [Department] = ""Sales""")
> or Access VBA Help shows the example like this:
[quoted text clipped - 20 lines]
> |
> | Curt