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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Dcount (multiple criteria) 3
Access Dcount function in access 0
Dcount operation 2
Access MS Access DCount function problem 0
Problem using Dcount 3
DCount with Date criteria 2
DCount alwaysreturning 1 0
DCount problem 12

Back
Top