DCount Problem

  • Thread starter Thread starter DS
  • Start date Start date
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
 
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.
 
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)
 
Back
Top