By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 2,606 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Question about summing a total in a report

P: n/a
Den
I have a report where at the report footer, I have a field that sums
up the total of a field in the report. My problem is, when the report
is empty the field shows #error. Would someone tell me a way to have
it so that when the report is empty, the sum shows as a zero or
displays a message like "No records in report"? Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try a Control Source of:
=IIf(IsError(Sum([MyField])), 0, Sum([MyField]))

You can also avoid the error by canceling the report's NoData event, so it
shows a MsgBox and never opens if there are no records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Den" <dp*********@toyonassociates.com> wrote in message
news:bb**************************@posting.google.c om...
I have a report where at the report footer, I have a field that sums
up the total of a field in the report. My problem is, when the report
is empty the field shows #error. Would someone tell me a way to have
it so that when the report is empty, the sum shows as a zero or
displays a message like "No records in report"? Thanks.

Nov 12 '05 #2

P: n/a
Try looking at the 'On No Data' event. you can either cancel the
report by setting Cancel = True, and/or use it to display a message.
If you still want to see the empty report, you can modify the
calculation through this (or even hide it).

dp*********@toyonassociates.com (Den) wrote in message news:<bb**************************@posting.google. com>...
I have a report where at the report footer, I have a field that sums
up the total of a field in the report. My problem is, when the report
is empty the field shows #error. Would someone tell me a way to have
it so that when the report is empty, the sum shows as a zero or
displays a message like "No records in report"? Thanks.

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.