reports

M

Matt

I have a report with several subreports that have prices of products on
them...on the main report i have a text box that adds the prices to give a
single cost. However, if one of the subreports doesnt have a product it
clearly will not have a price on it. If it doesnt have a price then my text
box that is calculating the single price will not work....this is not the
case with forms for some reason. Is there a solution?
 
S

Sprinks

Matt,

Use the Nz() function to convert nulls to a value of zero.

=Nz([MyField])

Sprinks
 
M

Matt

I tried using the NZ fucntion like you have said however, when no product is
selected for the subreport it doesnt appear on the report. If the subreport
doesnt appear i get a #error...

Sprinks said:
Matt,

Use the Nz() function to convert nulls to a value of zero.

=Nz([MyField])

Sprinks

Matt said:
I have a report with several subreports that have prices of products on
them...on the main report i have a text box that adds the prices to give a
single cost. However, if one of the subreports doesnt have a product it
clearly will not have a price on it. If it doesnt have a price then my text
box that is calculating the single price will not work....this is not the
case with forms for some reason. Is there a solution?
 
S

Sprinks

Matt,

I'm not a Reports expert, so there may be a more elegant way of doing this,
but one way that should work is to make your current controls invisible, add
another control for each control you're summing, test for an error condition,
and sum the new controls:

=IIf(IsError([ControlToBeSummed],0,[ControlToBeSummed])

Sprinks

Matt said:
I tried using the NZ fucntion like you have said however, when no product is
selected for the subreport it doesnt appear on the report. If the subreport
doesnt appear i get a #error...

Sprinks said:
Matt,

Use the Nz() function to convert nulls to a value of zero.

=Nz([MyField])

Sprinks

Matt said:
I have a report with several subreports that have prices of products on
them...on the main report i have a text box that adds the prices to give a
single cost. However, if one of the subreports doesnt have a product it
clearly will not have a price on it. If it doesnt have a price then my text
box that is calculating the single price will not work....this is not the
case with forms for some reason. Is there a solution?
 
M

Matt

Thanks

Sprinks said:
Matt,

I'm not a Reports expert, so there may be a more elegant way of doing this,
but one way that should work is to make your current controls invisible, add
another control for each control you're summing, test for an error condition,
and sum the new controls:

=IIf(IsError([ControlToBeSummed],0,[ControlToBeSummed])

Sprinks

Matt said:
I tried using the NZ fucntion like you have said however, when no product is
selected for the subreport it doesnt appear on the report. If the subreport
doesnt appear i get a #error...

Sprinks said:
Matt,

Use the Nz() function to convert nulls to a value of zero.

=Nz([MyField])

Sprinks

:

I have a report with several subreports that have prices of products on
them...on the main report i have a text box that adds the prices to give a
single cost. However, if one of the subreports doesnt have a product it
clearly will not have a price on it. If it doesnt have a price then my text
box that is calculating the single price will not work....this is not the
case with forms for some reason. Is there a solution?
 
Top