If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Error
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! -- www.Marzetti.com |
#2
|
|||
|
|||
#Error
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" wrote: 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! -- www.Marzetti.com |
#3
|
|||
|
|||
#Error
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" wrote: 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" wrote: 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! -- www.Marzetti.com |
#4
|
|||
|
|||
#Error
Whoops! Please disregard my other response. I found my typo.
Your suggestion works. Thanks a bunch! -- www.Marzetti.com "Duane Hookom" wrote: 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" wrote: 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! -- www.Marzetti.com |
#5
|
|||
|
|||
#Error
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" wrote: Whoops! Please disregard my other response. I found my typo. Your suggestion works. Thanks a bunch! -- www.Marzetti.com "Duane Hookom" wrote: 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" wrote: 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! -- www.Marzetti.com |
Thread Tools | |
Display Modes | |
|
|