DCount Problem

D

DS

This DCount Doesn't seem to returning the value I'm asking for. It's
counting the number of all the checks as opposed to the number of
ChkWalkouts for a server.

DCount("ChkWalkOut","tblChecks","ChkServer = " &
Reports!rptCashOutServer!ChkServer AND "ChkWalkOut=-1")

Any help is appreciated.
Thanks
DS
 
D

Dirk Goldgar

In
DS said:
This DCount Doesn't seem to returning the value I'm asking for. It's
counting the number of all the checks as opposed to the number of
ChkWalkouts for a server.

DCount("ChkWalkOut","tblChecks","ChkServer = " &
Reports!rptCashOutServer!ChkServer AND "ChkWalkOut=-1")

You need to get the word "AND" into the criteria string, not outside of
it, where it is now. Try this:

DCount("ChkWalkOut","tblChecks",
"ChkServer = " & Reports!rptCashOutServer!ChkServer &
" AND ChkWalkOut=-1")

Note that I entered that on multiple lines for clarity of posting, but
it would normally all be on one line, unless (in VBA code)
line-continuation characters were added at the ends of the firdt two
lines.
 
D

DS

Great Thanks
That worked!
DS
Dirk Goldgar said:
In

You need to get the word "AND" into the criteria string, not outside of
it, where it is now. Try this:

DCount("ChkWalkOut","tblChecks",
"ChkServer = " & Reports!rptCashOutServer!ChkServer &
" AND ChkWalkOut=-1")

Note that I entered that on multiple lines for clarity of posting, but it
would normally all be on one line, unless (in VBA code) line-continuation
characters were added at the ends of the firdt two lines.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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

DCount In Otherdb 27
Report Reference 2
Access Dcount (multiple criteria) 3
For Loop 6
DCount alwaysreturning 1 0
DCount in Subform question 1
DCount Help on Subreport 5
DCount Porblem 4

Top