Has Data Function and Sub Reports

I

IanR

Hello - If anyone can point me in the right direction with the following I
would be most grateful:-

My report consists of 3 parts:

rptStandardCases - which is the main report.
subrptQualityCalls - which is contained within the above one.
subrptConsultantTasks - which is contained within subrptQualityCalls

The problem I have is that if subrptQualityCalls contains no data then the
report does not appear and neither does subrptConsultantTasks even if the
latter contains data.Am I right in thinking there is no way around this?

If not I could put both subrptQualityCalls and subrptConsultantTasks
directly in rptStandardCases.The 3 reports contain data which I display as a
running total. If subrptQualityCalls contains no data how do I use the Has
Data function to provide a zero so the running total will still be
calculated? ie where should I enter the has data function - in the field
where the calculation is done, in the field that is null because there is no
data or ....... ? I have seen some examples which use the following but
haven't been successful in getting it to work.

=IIf(subreport.Report.HasData, subreport.Report.Text52,0)

As I am fairly new to Access I haven't been able to translate this into my
report. Assuming the name of the report is subrptQualityCalls and the field
that is null is Calc1 would this be:

=IIf(subrptQualityCalls.Report.HasData, subrptQualityCalls.Report.Calc1,0)

Thanks for your help
 
M

Marshall Barton

IanR said:
Hello - If anyone can point me in the right direction with the following I
would be most grateful:-

My report consists of 3 parts:

rptStandardCases - which is the main report.
subrptQualityCalls - which is contained within the above one.
subrptConsultantTasks - which is contained within subrptQualityCalls

The problem I have is that if subrptQualityCalls contains no data then the
report does not appear and neither does subrptConsultantTasks even if the
latter contains data.Am I right in thinking there is no way around this?

If not I could put both subrptQualityCalls and subrptConsultantTasks
directly in rptStandardCases.The 3 reports contain data which I display as a
running total. If subrptQualityCalls contains no data how do I use the Has
Data function to provide a zero so the running total will still be
calculated? ie where should I enter the has data function - in the field
where the calculation is done, in the field that is null because there is no
data or ....... ? I have seen some examples which use the following but
haven't been successful in getting it to work.

=IIf(subreport.Report.HasData, subreport.Report.Text52,0)

As I am fairly new to Access I haven't been able to translate this into my
report. Assuming the name of the report is subrptQualityCalls and the field
that is null is Calc1 would this be:

=IIf(subrptQualityCalls.Report.HasData, subrptQualityCalls.Report.Calc1,0)


You defintely need to put both subreports on the main
report.

Your expression:
=IIf(subrptQualityCalls.Report.HasData,subrptQualityCalls.Report.Calc1,0)

is correct... IF the name of the subreport **control** on
the main report has the same name as the report object it is
displaying. I.e. the name of the report is not used in the
expression, it's the name of the control that must be used.
 

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