Adding two subtotals from two subreports in a main report

G

Guest

I have a report called SWO R that has two subreports in it called LABOUR R
and PARTS R. Both of these subreports have subtotals in them created using a
text box and I would like to add the two subtotals together in the main
report but I can't seem to get it to work. Does anyone have any ideas of how
I can do this?
 
D

Duane Hookom

If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
 
G

Guest

So I put that control source in and once I press tab to get to the next field
it gives an error: The expression you entered contains invalid syntax. You
may have entered and operand without and operator. This is what I typed in:
=[LABOUR R].Report!LABOUR SUBTOTAL + [PARTS R].Report!PARTS SUBTOTAL

So my subreport names are LABOUR R & PARTS R the subtotal fields are called
LABOUR SUBTOTAL & PARTS SUBTOTAL


Duane Hookom said:
If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
--
Duane Hookom
MS Access MVP

Renee said:
I have a report called SWO R that has two subreports in it called LABOUR R
and PARTS R. Both of these subreports have subtotals in them created using
a
text box and I would like to add the two subtotals together in the main
report but I can't seem to get it to work. Does anyone have any ideas of
how
I can do this?
 
D

Duane Hookom

Either remove the spaces from your object names (my preference) or place
brackets around them.

=[LABOUR R].Report![LABOUR SUBTOTAL] + [PARTS R].Report![PARTS SUBTOTAL]

--
Duane Hookom
MS Access MVP


Renee said:
So I put that control source in and once I press tab to get to the next
field
it gives an error: The expression you entered contains invalid syntax. You
may have entered and operand without and operator. This is what I typed
in:
=[LABOUR R].Report!LABOUR SUBTOTAL + [PARTS R].Report!PARTS SUBTOTAL

So my subreport names are LABOUR R & PARTS R the subtotal fields are
called
LABOUR SUBTOTAL & PARTS SUBTOTAL


Duane Hookom said:
If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
--
Duane Hookom
MS Access MVP

Renee said:
I have a report called SWO R that has two subreports in it called LABOUR
R
and PARTS R. Both of these subreports have subtotals in them created
using
a
text box and I would like to add the two subtotals together in the main
report but I can't seem to get it to work. Does anyone have any ideas
of
how
I can do this?
 
G

Guest

Once I try putting the brackets around them and go to view the report it
comes up with a box saying to enter parameter value for LABOUR R.

Duane Hookom said:
Either remove the spaces from your object names (my preference) or place
brackets around them.

=[LABOUR R].Report![LABOUR SUBTOTAL] + [PARTS R].Report![PARTS SUBTOTAL]

--
Duane Hookom
MS Access MVP


Renee said:
So I put that control source in and once I press tab to get to the next
field
it gives an error: The expression you entered contains invalid syntax. You
may have entered and operand without and operator. This is what I typed
in:
=[LABOUR R].Report!LABOUR SUBTOTAL + [PARTS R].Report!PARTS SUBTOTAL

So my subreport names are LABOUR R & PARTS R the subtotal fields are
called
LABOUR SUBTOTAL & PARTS SUBTOTAL


Duane Hookom said:
If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
--
Duane Hookom
MS Access MVP

I have a report called SWO R that has two subreports in it called LABOUR
R
and PARTS R. Both of these subreports have subtotals in them created
using
a
text box and I would like to add the two subtotals together in the main
report but I can't seem to get it to work. Does anyone have any ideas
of
how
I can do this?
 
D

Duane Hookom

Make sure that your subreport control name (not necessarily the subreport
name) is [LABOUR R]. The subreport control generally inherits the name of
the subreport but this is not always true.

--
Duane Hookom
MS Access MVP

Renee said:
Once I try putting the brackets around them and go to view the report it
comes up with a box saying to enter parameter value for LABOUR R.

Duane Hookom said:
Either remove the spaces from your object names (my preference) or place
brackets around them.

=[LABOUR R].Report![LABOUR SUBTOTAL] + [PARTS R].Report![PARTS SUBTOTAL]

--
Duane Hookom
MS Access MVP


Renee said:
So I put that control source in and once I press tab to get to the next
field
it gives an error: The expression you entered contains invalid syntax.
You
may have entered and operand without and operator. This is what I typed
in:
=[LABOUR R].Report!LABOUR SUBTOTAL + [PARTS R].Report!PARTS SUBTOTAL

So my subreport names are LABOUR R & PARTS R the subtotal fields are
called
LABOUR SUBTOTAL & PARTS SUBTOTAL


:

If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source
like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
--
Duane Hookom
MS Access MVP

I have a report called SWO R that has two subreports in it called
LABOUR
R
and PARTS R. Both of these subreports have subtotals in them created
using
a
text box and I would like to add the two subtotals together in the
main
report but I can't seem to get it to work. Does anyone have any
ideas
of
how
I can do this?
 
G

Guest

Okay, that seemed to work. Thank you for your help

Duane Hookom said:
Make sure that your subreport control name (not necessarily the subreport
name) is [LABOUR R]. The subreport control generally inherits the name of
the subreport but this is not always true.

--
Duane Hookom
MS Access MVP

Renee said:
Once I try putting the brackets around them and go to view the report it
comes up with a box saying to enter parameter value for LABOUR R.

Duane Hookom said:
Either remove the spaces from your object names (my preference) or place
brackets around them.

=[LABOUR R].Report![LABOUR SUBTOTAL] + [PARTS R].Report![PARTS SUBTOTAL]

--
Duane Hookom
MS Access MVP


So I put that control source in and once I press tab to get to the next
field
it gives an error: The expression you entered contains invalid syntax.
You
may have entered and operand without and operator. This is what I typed
in:
=[LABOUR R].Report!LABOUR SUBTOTAL + [PARTS R].Report!PARTS SUBTOTAL

So my subreport names are LABOUR R & PARTS R the subtotal fields are
called
LABOUR SUBTOTAL & PARTS SUBTOTAL


:

If both subreports
- are in the same report section and
- will always contain records and
- they have a text box named "txtRptTotal" containg the subtotals
You can create a text box in the main report with a control source
like:

=[SWO R].Report!txtRptTotal + [LABOUR R].Report!txtRptTotal

If you don't find success, come back with some real values for us.
--
Duane Hookom
MS Access MVP

I have a report called SWO R that has two subreports in it called
LABOUR
R
and PARTS R. Both of these subreports have subtotals in them created
using
a
text box and I would like to add the two subtotals together in the
main
report but I can't seem to get it to work. Does anyone have any
ideas
of
how
I can do this?
 

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