Error in DCount in a Report Header

GeoffT

Registered User.
Local time
Today, 09:24
Joined
Feb 2, 2005
Messages
14
I have a report which provides annual statistics.
The report source is a query which, amongst all, contains a "year" field and a "boat" field.
The Year field is a choice field with values 01;02;03 etc.
The Boat field is a choice field with values AWB;ILB;XP .

I have been specifiying the year required by entering e.g "06" in the query criteria for the Year field.

In the rport header I wish to count how many records there are for each value of the Boat field. To do this I have three unbound text boxes and use the DCount() function to obtain count values, as in, e.g. :-
DCount("[Boat]","SDQuery",[Boat]='AWB' ")

This all works very well. The detail section of the report provides details of the selected records.

However, the problem arose when I decided to get the query to ask me for the required year, by specifying [Year Please ?] in the criteria of the of the query's Year field, instead of having to alter the query each time I want a different year. The query itself responds correctly to this and returns the records for the specified year with no problem.

The detail section of the report also comes out correctly.

But - the three DCount() boxes in the report header no longer count - they are each replaced with a #Error output message.

I can find no reason for this - has anyone any suggestions please ?

Regards
GeoffT

---------------------------------------​

P.S I'm new to the forum - excuse me if I offend the conventionms, and don't hesitate to tell if so.
 

Users who are viewing this thread

Back
Top Bottom