Hi
In my report I have data grouped by station. Some of the records have
check boxes checked to indicate whether the station was declared
available or unavailable at the time of incident, and whether they
were allowed to proceed.
I added a field to the query (qrycombined) that the report is based on
to calculate the following:
STATUS: IIf([CALL_NO] Is Null,0,IIf([DECLARED_AVAILABLE]=Yes And
[PROCEED]=Yes,1,IIf([DECLARED_AVAILABLE]=Yes And
[PROCEED]=No,2,IIf([DECLARED_AVAILABLE]=No And
[PROCEED]=No,3,IIf([DECLARED_AVAILABLE]=No And [PROCEED]=Yes,4,0)))))
In my report, I want to count all the 1s and all the 2s and all the 3s
and all the 4s separately for each station, and a final count for all
stations.
I have created a subreport, and have a formula which seems to do this
for all stations (in a text box):
=DCount("[STATUS]","qrycombined","[STATUS]=2") (similarly for 1,3,and
4)
But I can't figure out how to narrow that down to station. I tried to
change it to =DCount("[STATUS]","qrycombined","[STATUS]=2 AND
[STATION_CODE]=Reports!subreportfailures![STATION_CODE]") but that
gives an Error message. Am I on the right lines with this?
I can count the number of ticks in each field for each station which
works fine, using Sum, but this isn't what I want!. I'm sure it should
be obvious - hope it is to someone!
Thanks
Kirsty