The NZ function

G

Guest

Hello,

I have a main report that needs to add a field from a sub report. I keep
getting #error.

This is what I have on the Main Report to test for errors:

=(NZ([Blank Weekly subreport].Report!SUMOTRA))

This is what I have on the Sub report, which is Blank Weekly Subreport

=Sum(Nz([OT rate]))
I have tried every possible combination I can think of. Please help.

JC
Papi
 
D

Dirk Goldgar

Joe C said:
Hello,

I have a main report that needs to add a field from a sub report. I
keep getting #error.

This is what I have on the Main Report to test for errors:

=(NZ([Blank Weekly subreport].Report!SUMOTRA))

This is what I have on the Sub report, which is Blank Weekly Subreport

=Sum(Nz([OT rate]))
I have tried every possible combination I can think of. Please help.

JC
Papi

Is the subreport completely blank, by any chance? If so, the nnz()
function posted by Keri Hardwick is probably your solution. Code and an
explanation are posted here:

http://www.mvps.org/access/forms/frm0022.htm
Forms: #Error when the Subform has no records

Although the article talks about subforms, it's equally true and useful
for subreports.
 
G

Guest

Dirk,

Thank you for your help.

The sub is a many side of a one to many and there will be times that a one
will not have any many. Is this what you mean by "completely blank"?

JC


Dirk Goldgar said:
Joe C said:
Hello,

I have a main report that needs to add a field from a sub report. I
keep getting #error.

This is what I have on the Main Report to test for errors:

=(NZ([Blank Weekly subreport].Report!SUMOTRA))

This is what I have on the Sub report, which is Blank Weekly Subreport

=Sum(Nz([OT rate]))
I have tried every possible combination I can think of. Please help.

JC
Papi

Is the subreport completely blank, by any chance? If so, the nnz()
function posted by Keri Hardwick is probably your solution. Code and an
explanation are posted here:

http://www.mvps.org/access/forms/frm0022.htm
Forms: #Error when the Subform has no records

Although the article talks about subforms, it's equally true and useful
for subreports.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Joe C said:
Thank you for your help.

You're welcome.
The sub is a many side of a one to many and there will be times that
a one will not have any many. Is this what you mean by "completely
blank"?

Yes. In that case, Access doesn't really create the subreport, so
references to the controls on it fail. That's what the Keri's nnz()
function handles.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top