Dcount function

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

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
| 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
 
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
 
Back
Top