Subreport total error when no data

S

SAC

I have a main report - rptInvoices

and a sub report - rptInvoicesBulk subreport

On the subform I have a control which sums all the extended prices, called
txtSumPriceExt

On the main form I have a control that uses the txtSumPriceExt on the
subform as it's data source.

The problem arises when I have no data for the subform so the control on the
main form errors.

How can I fix this?

Thanks for your help.
 
D

Duane Hookom

You should be able to use a text box in the main report with a control source
like:
=IIf([rptInvoicesBulk subreport].Report.HasData, [rptInvoicesBulk
subreport].Report!txtSumPriceExt, 0)
 
S

SAC

Thanks Duane!!

Duane Hookom said:
You should be able to use a text box in the main report with a control
source
like:
=IIf([rptInvoicesBulk subreport].Report.HasData, [rptInvoicesBulk
subreport].Report!txtSumPriceExt, 0)

--
Duane Hookom
Microsoft Access MVP


SAC said:
I have a main report - rptInvoices

and a sub report - rptInvoicesBulk subreport

On the subform I have a control which sums all the extended prices,
called
txtSumPriceExt

On the main form I have a control that uses the txtSumPriceExt on the
subform as it's data source.

The problem arises when I have no data for the subform so the control on
the
main form errors.

How can I fix this?

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