By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

subreport wont show up

P: n/a
Arggg... I have a report that calls up numbers from two subreports. One
deals with project labor the other expenses. on each subreport, there is a
calc fields that sums cost and price. the main report then references those
fields to do more calculations. I.e. add LaborCost from labor subreport and
ExpensesCost from expenses subreport. There are a number of these
calculations and they work as expected except when one of the subreports has
no data, i.e. there were no expenses. I have a form that displays this
information and I got around the #error that access kept giving me by using
an Iif statement to count the records first and enter 0 if the count was 0.
This works on the form but not the report. So, on my report if one of the
subreports does not have any records, the subreport does not get displayed
thus #error! any thoughts?
Oct 10 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Bump...

"Robert" <no**@none.comwrote in message
news:L3******************@fe06.news.easynews.com.. .
Arggg... I have a report that calls up numbers from two subreports. One
deals with project labor the other expenses. on each subreport, there is a
calc fields that sums cost and price. the main report then references
those fields to do more calculations. I.e. add LaborCost from labor
subreport and ExpensesCost from expenses subreport. There are a number of
these calculations and they work as expected except when one of the
subreports has no data, i.e. there were no expenses. I have a form that
displays this information and I got around the #error that access kept
giving me by using an Iif statement to count the records first and enter 0
if the count was 0. This works on the form but not the report. So, on my
report if one of the subreports does not have any records, the subreport
does not get displayed thus #error! any thoughts?

Oct 11 '06 #2

P: n/a
Nevermind - the answer is... IIF(IsError(....

"Robert" <no**@none.comwrote in message
news:Yv*******************@fe12.news.easynews.com. ..
Bump...

"Robert" <no**@none.comwrote in message
news:L3******************@fe06.news.easynews.com.. .
>Arggg... I have a report that calls up numbers from two subreports. One
deals with project labor the other expenses. on each subreport, there is
a calc fields that sums cost and price. the main report then references
those fields to do more calculations. I.e. add LaborCost from labor
subreport and ExpensesCost from expenses subreport. There are a number of
these calculations and they work as expected except when one of the
subreports has no data, i.e. there were no expenses. I have a form that
displays this information and I got around the #error that access kept
giving me by using an Iif statement to count the records first and enter
0 if the count was 0. This works on the form but not the report. So, on
my report if one of the subreports does not have any records, the
subreport does not get displayed thus #error! any thoughts?


Oct 11 '06 #3

P: n/a

Robert wrote:
Arggg... I have a report that calls up numbers from two subreports. One
deals with project labor the other expenses. on each subreport, there is a
calc fields that sums cost and price. the main report then references those
fields to do more calculations. I.e. add LaborCost from labor subreport and
ExpensesCost from expenses subreport. There are a number of these
calculations and they work as expected except when one of the subreports has
no data, i.e. there were no expenses. I have a form that displays this
information and I got around the #error that access kept giving me by using
an Iif statement to count the records first and enter 0 if the count was 0.
This works on the form but not the report. So, on my report if one of the
subreports does not have any records, the subreport does not get displayed
thus #error! any thoughts?
Have you thought about using the HasData property of the report to
determine if it has any data or not, e.g.

if mysubreport.report.HasData then
' use the field on the subreport
else
' use 0
end if

Bruce

Oct 11 '06 #4

P: n/a
Nope, I didn't know about that, however, I found another work around using
IsError to convert those boxes to 0.

<de***************@gmail.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
>
Have you thought about using the HasData property of the report to
determine if it has any data or not, e.g.

if mysubreport.report.HasData then
' use the field on the subreport
else
' use 0
end if

Bruce

Oct 11 '06 #5

P: n/a
I use IsNumeric function is such cases. On the sub report, there could a box
called txtCountLabour
On the main form, I would have something like
=IIF(IsNumeric(Reports!rptLabour!txtCountLabour),
Reports!rptLabour!txtCountLabour,0)

If there is no data in the sub report, a 0 will be displayed instead.

HTH
Vayse

"Robert" <no**@none.comwrote in message
news:L3******************@fe06.news.easynews.com.. .
Arggg... I have a report that calls up numbers from two subreports. One
deals with project labor the other expenses. on each subreport, there is a
calc fields that sums cost and price. the main report then references
those fields to do more calculations. I.e. add LaborCost from labor
subreport and ExpensesCost from expenses subreport. There are a number of
these calculations and they work as expected except when one of the
subreports has no data, i.e. there were no expenses. I have a form that
displays this information and I got around the #error that access kept
giving me by using an Iif statement to count the records first and enter 0
if the count was 0. This works on the form but not the report. So, on my
report if one of the subreports does not have any records, the subreport
does not get displayed thus #error! any thoughts?

Oct 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.