Beeps (Programmer), thank you for your response. I've just spent the last 2 1/2 hours wrestling with this problem with another programmer with 18 years experience. The problem occurs when there are no records returned by the query. We basically tried everything. We actually tried your suggestion in all its permutations and it didn't work with the count. It appears to work with the number of orders, average of orders and totals because these amounts are calculated in the query. We assume then that even if the query returns no records, null or zero is buffered somewhere and then you can use the IfNull to perform the test. With counting the customers using the Count function, this is done in the report, not in the query. So if there are no customers, you can't do the comparison because a null or zero isn't buffered anywhere. However, there is a work-around for this. Use a test on one of the fields that does work, that does buffer a null, and then have the "IIf" respond with "No customers". However, the dates part of this report still doesn't work (we finally tried prompting for start and end dates from both the query and from the report) when there are no records selected by the query. We now think this is a glitch with Access. We went to the Microsoft "Northwind" demonstration program and tried to use the technique in the "Employee Sales by Country" Query and Report. It didn't work for us. But it doesn't work in "Northwind" either. If you don't believe us, try typing in 13-Aug-94 for the start and end dates for the "Employee Sales by Country" Query. It comes up with the field headings but not records. The record set is null. Then put the same date 13-Aug-94 in the report, and it says "You must enter a date between 10-Aug-94 and 5-Jun-96". It doesn't work in "Northwind" either. It is an error within Access. I have now spent untold hours of my time and the time of others to discover this.
Does anyone know of a work-around for prompting and displaying the start and end dates of a query/report in the report's "Report Header" when the report is based on a query which returns no records? Currently, this report is displaying "#Error" where "From StartDate to EndDate" should be displayed.