=sum of 2 fields from 2 subreports

N

nydia

Background: I created a database that keeps track of
clients and when they attend meetings with progress notes.
I'm trying to create a billing sheet, so that we can bill
our clients. The billing sheet has to have the individual
hours of service seperate from the group sessions, but, i
want them on the same sheet. This sheet will be sent out
on a weekly bases.

i created 2 queries, qry 1 has group information, how many
clients in group,date of meeting, duration of meeting. qry
2 has the same except it only has individual service
information. I then created 2 subreports based on these
queries. The main form is name, social security number,
address, program name. then the 2 subreports below that.

i put an unbound text box in each subform that will total
up how many service hours for group and how many service
hours for individual. it's =(sum([duration])) for box text
boxes because the field name is duration on both
subreports. What I need now is the put a text box on the
main form that will give a grand total of service hours,
this should total up the 2 text boxes in the subreports.
Can you show me how to do this.
 
M

Marshall Barton

nydia said:
Background: I created a database that keeps track of
clients and when they attend meetings with progress notes.
I'm trying to create a billing sheet, so that we can bill
our clients. The billing sheet has to have the individual
hours of service seperate from the group sessions, but, i
want them on the same sheet. This sheet will be sent out
on a weekly bases.

i created 2 queries, qry 1 has group information, how many
clients in group,date of meeting, duration of meeting. qry
2 has the same except it only has individual service
information. I then created 2 subreports based on these
queries. The main form is name, social security number,
address, program name. then the 2 subreports below that.

i put an unbound text box in each subform that will total
up how many service hours for group and how many service
hours for individual. it's =(sum([duration])) for box text
boxes because the field name is duration on both
subreports. What I need now is the put a text box on the
main form that will give a grand total of service hours,
this should total up the 2 text boxes in the subreports.
Can you show me how to do this.


You can use a text box in the same section (of the main
report) as the subreport controls. The text box's
expression would refer to the subreport total text box with
the syntax:
subreportcontrolname.Report.totaltextboxname
or if a subreport has a chance of not having any records to
total, using:
IIf(subreportcontrolname.Report.HasData,
subreportcontrolname.Report.totaltextboxname, 0)

So, to display the sum of the values from the two
subreports, you can use + between two references like the
above.
 

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