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

checking for NULL in a control source

P: n/a
Hi everyone,

I have a report that has a text box and the text box simply shows the
sum of the amount field in the report.

So, the control source is simple = SUM(Amount).

The problem is that sometimes the query can return no records. In that
case, my report just shows #ERROR for this field. What I would like to
do is check if the SUM(AMOUNT) value is NULL and if it is NULL, I would
like to just show 0.

With VBA, of course, it is straight forward. However, I have no idea
how to use it with the reporting stuff.

Appreciate any help you can give me.

Thanks,

Pankaj

Dec 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 7 Dec 2006 16:31:59 -0800, "de**********@gmail.com"
<de**********@gmail.comwrote:

If there is no data, then obviously there is no sum either.
An elegant solution is to write this in the Report_NoData event:
Msgbox "There is no data for your criteria",vbInformation
Cancel = True 'Close the report

-Tom.
>Hi everyone,

I have a report that has a text box and the text box simply shows the
sum of the amount field in the report.

So, the control source is simple = SUM(Amount).

The problem is that sometimes the query can return no records. In that
case, my report just shows #ERROR for this field. What I would like to
do is check if the SUM(AMOUNT) value is NULL and if it is NULL, I would
like to just show 0.

With VBA, of course, it is straight forward. However, I have no idea
how to use it with the reporting stuff.

Appreciate any help you can give me.

Thanks,

Pankaj
Dec 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.