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

#Error Message from SubReport

P: n/a
I have a main report that has a subreport to it. On the sub report I
have a running total. If there are no entries in the sub-report source
table the sum total returns the #Error message for the running sum
total.

I want to watch for this on the main report and replace the #Error with
a 0 (Zero) in the control on the main report.

I can not get this to happen. I have tried both an IF statement in VBA
and the IIF in the control itself. Both work fine if there is a value in
the sub-report, but when there is not I get the #Error.

I tried to use IsNull(My Control) to watch for the error but this is not
working.

Anyone know how I do this?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Michael Charney wrote:
I have a main report that has a subreport to it. On the sub report I
have a running total. If there are no entries in the sub-report source
table the sum total returns the #Error message for the running sum
total.

I want to watch for this on the main report and replace the #Error
with a 0 (Zero) in the control on the main report.

I can not get this to happen. I have tried both an IF statement in VBA
and the IIF in the control itself. Both work fine if there is a value
in the sub-report, but when there is not I get the #Error.

I tried to use IsNull(My Control) to watch for the error but this is
not working.

Anyone know how I do this?


Not too sure about the referencing of the subreport but i use the following
on my report;

=IIf(IsNull(Sum([AbsenceCost])),0,Sum([AbsenceCost]))

Were you using something like this?


Nov 12 '05 #2

P: n/a
Yes that is what I was doing. It does not place a 0 (Zero) in the field
if it returns the #Error.

What else can I do?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
Michael Charney wrote:
Yes that is what I was doing. It does not place a 0 (Zero) in the
field if it returns the #Error.

What else can I do?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


I find that with a bit of experimentation you can get that first part of the
IIF correct. At the moment, whatever you have in there is incorrect. Make
sure your reference to the subreport is correct. Check out the page on the
Access Web about correct referencing.
Nov 12 '05 #4

P: n/a
The page on the Access Web? Not sure I know about this. Can you give me
a link?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5

P: n/a
Michael Charney wrote:
The page on the Access Web? Not sure I know about this. Can you give
me a link?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


You could google it or see the FAQ but here it is;

http://www.mvps.org/access/forms/frm0022.htm

This specifc page may be what you need, or click on the Reports link.
Nov 12 '05 #6

P: n/a
Thanks!

This is exactly what I was trying to do!!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #7

P: n/a
Nothing wrote:
Thanks!

This is exactly what I was trying to do!!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Bookmark that site! :)
Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.