#Error

J

JohnLute

I have a text box with this
source:=[Reports]![rptFGPackConfigurations]![srptFGPKPrimarySecondaryResources]![SumWt]+[Reports]![rptFGPackConfigurations]![srptFGPKTertiaryResources]![SumWt]

How can I revise this so that the text box will properly display if one of
the [SumWt] fields is null? Currently, the text box displays #Error if one of
them is null.

Thanks for your help!
 
D

Duane Hookom

Are the values actually Null or are there no records in the subreport?
Assuming the text box is located on rptFGPackConfigurations, you can shorten
your expression to:
=[srptFGPKPrimarySecondaryResources].Report.[SumWt] +
[srptFGPKTertiaryResources].Report.[SumWt]
If your subreports might not contain records, try:
=IIf([srptFGPKPrimarySecondaryResources].Report.HasData,
[srptFGPKPrimarySecondaryResources].Report.[SumWt],0) +
IIf([srptFGPKTertiaryResources].Report.HasData,
[srptFGPKTertiaryResources].Report.[SumWt],0)
 
J

JohnLute

Hi, Duane!

There are no records in the subreport. The values in SumWt are from a
calculation.

I tried your suggestion but it returned a -1.0000 where I was expecting
892.42. Is the "0" conflicting with things?

--
www.Marzetti.com


Duane Hookom said:
Are the values actually Null or are there no records in the subreport?
Assuming the text box is located on rptFGPackConfigurations, you can shorten
your expression to:
=[srptFGPKPrimarySecondaryResources].Report.[SumWt] +
[srptFGPKTertiaryResources].Report.[SumWt]
If your subreports might not contain records, try:
=IIf([srptFGPKPrimarySecondaryResources].Report.HasData,
[srptFGPKPrimarySecondaryResources].Report.[SumWt],0) +
IIf([srptFGPKTertiaryResources].Report.HasData,
[srptFGPKTertiaryResources].Report.[SumWt],0)
--
Duane Hookom
Microsoft Access MVP


JohnLute said:
I have a text box with this
source:=[Reports]![rptFGPackConfigurations]![srptFGPKPrimarySecondaryResources]![SumWt]+[Reports]![rptFGPackConfigurations]![srptFGPKTertiaryResources]![SumWt]

How can I revise this so that the text box will properly display if one of
the [SumWt] fields is null? Currently, the text box displays #Error if one of
them is null.

Thanks for your help!
 
J

JohnLute

Whoops! Please disregard my other response. I found my typo.

Your suggestion works. Thanks a bunch!

--
www.Marzetti.com


Duane Hookom said:
Are the values actually Null or are there no records in the subreport?
Assuming the text box is located on rptFGPackConfigurations, you can shorten
your expression to:
=[srptFGPKPrimarySecondaryResources].Report.[SumWt] +
[srptFGPKTertiaryResources].Report.[SumWt]
If your subreports might not contain records, try:
=IIf([srptFGPKPrimarySecondaryResources].Report.HasData,
[srptFGPKPrimarySecondaryResources].Report.[SumWt],0) +
IIf([srptFGPKTertiaryResources].Report.HasData,
[srptFGPKTertiaryResources].Report.[SumWt],0)
--
Duane Hookom
Microsoft Access MVP


JohnLute said:
I have a text box with this
source:=[Reports]![rptFGPackConfigurations]![srptFGPKPrimarySecondaryResources]![SumWt]+[Reports]![rptFGPackConfigurations]![srptFGPKTertiaryResources]![SumWt]

How can I revise this so that the text box will properly display if one of
the [SumWt] fields is null? Currently, the text box displays #Error if one of
them is null.

Thanks for your help!
 
D

Duane Hookom

Try to be more explicit with your questions in the future. I realize there is
a fine line between:
"How can I revise this so that the text box will
properly display if one of the [SumWt] fields
is null? Currently, the text box displays #Error
if one of them is null."
and
"There are no records in the subreport."

However, the solutions to the problem are different.

--
Duane Hookom
Microsoft Access MVP


JohnLute said:
Whoops! Please disregard my other response. I found my typo.

Your suggestion works. Thanks a bunch!

--
www.Marzetti.com


Duane Hookom said:
Are the values actually Null or are there no records in the subreport?
Assuming the text box is located on rptFGPackConfigurations, you can shorten
your expression to:
=[srptFGPKPrimarySecondaryResources].Report.[SumWt] +
[srptFGPKTertiaryResources].Report.[SumWt]
If your subreports might not contain records, try:
=IIf([srptFGPKPrimarySecondaryResources].Report.HasData,
[srptFGPKPrimarySecondaryResources].Report.[SumWt],0) +
IIf([srptFGPKTertiaryResources].Report.HasData,
[srptFGPKTertiaryResources].Report.[SumWt],0)
--
Duane Hookom
Microsoft Access MVP


JohnLute said:
I have a text box with this
source:=[Reports]![rptFGPackConfigurations]![srptFGPKPrimarySecondaryResources]![SumWt]+[Reports]![rptFGPackConfigurations]![srptFGPKTertiaryResources]![SumWt]

How can I revise this so that the text box will properly display if one of
the [SumWt] fields is null? Currently, the text box displays #Error if one of
them is null.

Thanks for your help!
 

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