Simplest solution is to cancel the NoData event of the report, so it does
not show if there are no records.
The #Error occurs in calculated controls when there is no data. Basically
the calculation is referring to something that does not exist, and so
generates an error.
You can avoid that in calculated controls by testing the HasData property
of the report, e.g. setting the Control Source of the text box to:
=If([Report].[HasData], [Quantity] * [UnitPrice], Null)
Note that you also need to make sure the Name of the calculated text box
is not the same as the name of any field in the report's RecordSource.
Access gets confused if the control has the same Name as a field, but is
bound to something else.
The issue with subreports is the same: you get nothing at all if there are
no records to show. You could work around that by putting a text box on
the main report just above the subreport control names Sub1, and setting
the ContolSource of the text box to:
=IIf([Sub1].[Report].[HasData], Null, "Nuffin 2 show.")
HTH
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Drew said:
How can I make my ADP Report show a "No records" or 0 if there are no
records? I am using a SP and if the SP returns nothing then I get a
#Error, or if the report has been incorporated into another report as a
subreport, then the subreport does not show at all if there are no
records.
Thanks,
Drew