#Error when calling subreport txt box with no data

G

Guest

When there is no data in the subreport the main report calling an unbound
text box displays #Error. I would like for the #Error to say “No Dataâ€
instead.

Background Information:

Report with 5 Sub Reports.
Each sub report has an unbound text box that counts a specific field or
calculates a total. Then this text box is called in a summary area on the
main report. When there is no data in the sub report listed “#Error†appears
in main report. I would like to either have it list the text “No Data†or
“0â€.
I have tried the “on open†and “on no data†events to even list something I
could call on the main report.

Here is one of the unbound text box control data on a subreport…
txtAppliedFor
=Count(IIf([Patent_Status]='1',1,Null))

This is how it’s called on the main report
=[subrptPatents].Report!txtAppliedFor

Any help would be appreciated. I have been trying different things for a
few days..

Thank you,
Danielle
 
M

Marshall Barton

Dani Pepper said:
When there is no data in the subreport the main report calling an unbound
text box displays #Error. I would like for the #Error to say “No Data”
instead.

Background Information:

Report with 5 Sub Reports.
Each sub report has an unbound text box that counts a specific field or
calculates a total. Then this text box is called in a summary area on the
main report. When there is no data in the sub report listed “#Error” appears
in main report. I would like to either have it list the text “No Data” or
“0”.
I have tried the “on open” and “on no data” events to even list something I
could call on the main report.

Here is one of the unbound text box control data on a subreport…
txtAppliedFor
=Count(IIf([Patent_Status]='1',1,Null))

This is how it’s called on the main report
=[subrptPatents].Report!txtAppliedFor


Change that to:

=IIf(subrptPatents.eport.HasData,subrptPatents.Report!txtAppliedFor,"No
Data")
 
G

Guest

Thank you. It worked perfectly! You have no idea how much time I spent on
that. Again, Thank you.

Danielle

Marshall Barton said:
Dani Pepper said:
When there is no data in the subreport the main report calling an unbound
text box displays #Error. I would like for the #Error to say “No Dataâ€
instead.

Background Information:

Report with 5 Sub Reports.
Each sub report has an unbound text box that counts a specific field or
calculates a total. Then this text box is called in a summary area on the
main report. When there is no data in the sub report listed “#Error†appears
in main report. I would like to either have it list the text “No Data†or
“0â€.
I have tried the “on open†and “on no data†events to even list something I
could call on the main report.

Here is one of the unbound text box control data on a subreport…
txtAppliedFor
=Count(IIf([Patent_Status]='1',1,Null))

This is how it’s called on the main report
=[subrptPatents].Report!txtAppliedFor


Change that to:

=IIf(subrptPatents.eport.HasData,subrptPatents.Report!txtAppliedFor,"No
Data")
 

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