Malcy
01-05-2005, 04:22 AM
Hi
I am trying to count valid records on a grouped report. I have used the following code in the ControlSource for the textbox
=DCount("bSup","tblPurpRev","lngCntRef = " & [txtCntRef] And [ysnSup]="-1 ")
The [txtCntRef] and [ysnSup] refer to controls on the report.
I set up test data which should have one grouping (lngCntRef = 1) giving a result of 5 and the other grouping (lngCntRef = 2) giving a result of 0
Instead what I get is 10 for the first group and 0 for the second.
What it seems to be doing is saying if [ysnSup] = -1 then count the total number of fields with a [ysnSup] checkbox, rather than just those records where the checkbox value is -1 (which is what I want it to do).
How can I correct this?
Any help would be most appreciated
I am trying to count valid records on a grouped report. I have used the following code in the ControlSource for the textbox
=DCount("bSup","tblPurpRev","lngCntRef = " & [txtCntRef] And [ysnSup]="-1 ")
The [txtCntRef] and [ysnSup] refer to controls on the report.
I set up test data which should have one grouping (lngCntRef = 1) giving a result of 5 and the other grouping (lngCntRef = 2) giving a result of 0
Instead what I get is 10 for the first group and 0 for the second.
What it seems to be doing is saying if [ysnSup] = -1 then count the total number of fields with a [ysnSup] checkbox, rather than just those records where the checkbox value is -1 (which is what I want it to do).
How can I correct this?
Any help would be most appreciated