Adding Fields from Multiple Reports

F

franklinbukoski

I have multiple reports (on a subreport) that calculate total records in each
report with the following in each reports header:

=Count(*)

How do I write the formula to add the values from each subreport to and
present in the parent report header?

Is it:
reports.report1.field1+reports.report2.field2
 
D

Duane Hookom

If all of the subreports are going to return at least one record you should
be able to use a control source like:
=subrptCtlA.Report.txtA + sburptCtlB.Report.txtB +...
If one or more subreport won't return records you need to use the HasData
property like:
=IIf(subrptCtlA.Report.HasData, subrptCtlA.Report.txtA,0)
 
F

franklinbukoski

Sir,

What does CtlA and txtA refer to?

I tried using the textbox label name and text name and it did not work.
 
F

franklinbukoski

This is what I used to test it and did not work:

=IIf(lable64.mt for bc awards.HasData, lable64.mt for bc awards.txt163,0)+
(lable64.mt for bc ncoer past due.HasData, lable64.mt for bc ncoer past
due.txt163,0)
 
D

Duane Hookom

If you want specific help, you should reply with an description of your
control names. If you use spaces in control names or other object names, you
need to wrap the names in []s. Also, I can't imagine a subreport control with
a name beginning with "lable" which suggests a label control.
 
F

franklinbukoski

Yes sir,

Learning Access through trial and error is very frustrating. I don't know
what control names are. I inserted a textbox in the report header and in the
right of the two boxes that appear typed =Count(*) which I learned through
the discussion group online.

I then typed a lable in the left part of the textbox. When I click on the
lable, lable164 appears in my toolbar, so I assumed this was the CtlA
referred to below, and when I clicked on the textbox part, text163 appeared
in the toolbar, so I assumed this was the txtA referred to below.

Duane Hookom said:
If you want specific help, you should reply with an description of your
control names. If you use spaces in control names or other object names, you
need to wrap the names in []s. Also, I can't imagine a subreport control with
a name beginning with "lable" which suggests a label control.

--
Duane Hookom
Microsoft Access MVP


franklinbukoski said:
This is what I used to test it and did not work:

=IIf(lable64.mt for bc awards.HasData, lable64.mt for bc awards.txt163,0)+
(lable64.mt for bc ncoer past due.HasData, lable64.mt for bc ncoer past
due.txt163,0)
 
D

Duane Hookom

A subreport is a control on a main report. Your text boxes are controls on
reports. My initial suggestion took guesses at subreport control and text box
control names. You would need to substitute in your actual control names. I
you have spaces in control names, make sure you place []s around the names.
--
Duane Hookom
Microsoft Access MVP


franklinbukoski said:
Yes sir,

Learning Access through trial and error is very frustrating. I don't know
what control names are. I inserted a textbox in the report header and in the
right of the two boxes that appear typed =Count(*) which I learned through
the discussion group online.

I then typed a lable in the left part of the textbox. When I click on the
lable, lable164 appears in my toolbar, so I assumed this was the CtlA
referred to below, and when I clicked on the textbox part, text163 appeared
in the toolbar, so I assumed this was the txtA referred to below.

Duane Hookom said:
If you want specific help, you should reply with an description of your
control names. If you use spaces in control names or other object names, you
need to wrap the names in []s. Also, I can't imagine a subreport control with
a name beginning with "lable" which suggests a label control.

--
Duane Hookom
Microsoft Access MVP


franklinbukoski said:
This is what I used to test it and did not work:

=IIf(lable64.mt for bc awards.HasData, lable64.mt for bc awards.txt163,0)+
(lable64.mt for bc ncoer past due.HasData, lable64.mt for bc ncoer past
due.txt163,0)

:

If all of the subreports are going to return at least one record you should
be able to use a control source like:
=subrptCtlA.Report.txtA + sburptCtlB.Report.txtB +...
If one or more subreport won't return records you need to use the HasData
property like:
=IIf(subrptCtlA.Report.HasData, subrptCtlA.Report.txtA,0)
--
Duane Hookom
Microsoft Access MVP


:

I have multiple reports (on a subreport) that calculate total records in each
report with the following in each reports header:

=Count(*)

How do I write the formula to add the values from each subreport to and
present in the parent report header?

Is it:
reports.report1.field1+reports.report2.field2
 

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