reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Matt,

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

=Nz([MyField])

Sprinks
 
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?
 
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?
 
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?
 

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

Back
Top