Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caluclated Report Field based on subreport showing #ERROR

Status
Not open for further replies.

boysrus

Programmer
Jul 9, 2001
12
0
0
US
I have a calculated field on a report that adds up fields from its subreport. The subreport is based on a query. The report runs fine when the query produces records. But if the query does not contain any records, (and therefore the subreport is blank) the calcualted field on the main report shows #Error. Any idea on how to get around this?
 
You need to be able to handle divide by zero or null situations.

Lookup the nz function and use it in formulas often. If you let me know the field that gets the error and what it is doing I might be able to give you a better answer.

Chucky

b-go.gif
 
The problem is that the query (in the sub-report) is a cross-tab based on a date selection criteria. It is possible, that there is no data for the dates chosen. So the cross-tab query comes back with zero records.

Then the main report is trying to look for fields created by the cross-tab, but of course, there are no records. That is when I get the error.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top