Sum of another text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a added a text box to the footer of my report and I want to get the
total of an another text box in the detail section with a name of GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
You can't sum a control from another section. You can generally sum the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])
 
I don't quite understand what you mean? Are you saying that I can't get the
sum of the control from the footer section instead it would have to be in the
detail section where the control was created.

What I would like to do is I have a control (text box) in the detail sectiod
that displays the sum of some fields from a table. Now I would like to get
the sum of all these amounts. What's the best way of going about this?

Duane Hookom said:
You can't sum a control from another section. You can generally sum the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])

--
Duane Hookom
MS Access MVP
--

Tina said:
I have a added a text box to the footer of my report and I want to get the
total of an another text box in the detail section with a name of
GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
I would also like to add: the text box I created in my detail section is
called GLAmount and the Control Source is
=Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),"$0.00 ")

I now would like the sum of all these amounts. Is there a way to do this?

Tina said:
I don't quite understand what you mean? Are you saying that I can't get the
sum of the control from the footer section instead it would have to be in the
detail section where the control was created.

What I would like to do is I have a control (text box) in the detail sectiod
that displays the sum of some fields from a table. Now I would like to get
the sum of all these amounts. What's the best way of going about this?

Duane Hookom said:
You can't sum a control from another section. You can generally sum the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])

--
Duane Hookom
MS Access MVP
--

Tina said:
I have a added a text box to the footer of my report and I want to get the
total of an another text box in the detail section with a name of
GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
You could set up a running sum on a control and reference the control name
in the control source of a text box in your footer. Another method would be
to use:

=Sum(Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),0))

I think I have suggested to you several time previously that you should not
use "$0.00 " in your Nz() function.

--
Duane Hookom
MS Access MVP
--

Tina said:
I would also like to add: the text box I created in my detail section is
called GLAmount and the Control Source is
=Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),"$0.00 ")

I now would like the sum of all these amounts. Is there a way to do this?

Tina said:
I don't quite understand what you mean? Are you saying that I can't get
the
sum of the control from the footer section instead it would have to be in
the
detail section where the control was created.

What I would like to do is I have a control (text box) in the detail
sectiod
that displays the sum of some fields from a table. Now I would like to
get
the sum of all these amounts. What's the best way of going about this?

Duane Hookom said:
You can't sum a control from another section. You can generally sum the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])

--
Duane Hookom
MS Access MVP
--

I have a added a text box to the footer of my report and I want to get
the
total of an another text box in the detail section with a name of
GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
Thanks, that worked but now I have to do it for the rest of my controls. I
need a total for each one:

I tried the adding another 2 text boxes in the footer section but I don't
get a result:

=Sum(IIf([rpt_GL_Revision subreport].Report.HasData,[rpt_GL_Revision
subreport].Report.SumOfGL,0))

=Sum([Planned Budget]-[SumGL_Amt]+IIf([rpt_GL_Revision
subreport].Report.HasData,[rpt_GL_Revision subreport].Report.SumOfGL,0))

Duane Hookom said:
You could set up a running sum on a control and reference the control name
in the control source of a text box in your footer. Another method would be
to use:

=Sum(Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),0))

I think I have suggested to you several time previously that you should not
use "$0.00 " in your Nz() function.

--
Duane Hookom
MS Access MVP
--

Tina said:
I would also like to add: the text box I created in my detail section is
called GLAmount and the Control Source is
=Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),"$0.00 ")

I now would like the sum of all these amounts. Is there a way to do this?

Tina said:
I don't quite understand what you mean? Are you saying that I can't get
the
sum of the control from the footer section instead it would have to be in
the
detail section where the control was created.

What I would like to do is I have a control (text box) in the detail
sectiod
that displays the sum of some fields from a table. Now I would like to
get
the sum of all these amounts. What's the best way of going about this?

:

You can't sum a control from another section. You can generally sum the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])

--
Duane Hookom
MS Access MVP
--

I have a added a text box to the footer of my report and I want to get
the
total of an another text box in the detail section with a name of
GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
I would have to think there is a better way to accomplish this rather than
DSum()s and attempting to sum the results of references to controls on
subreports.

I really don't know your data or what you are attempting to do. I would
think you could replace
=Sum(Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),0))
with something much more efficient. Perhaps you could create a query based
on qry_gl_const that groups by GL_ID and sums InvoiceAmt. Then include this
query in your reports record source and join the GL_ID fields. This would
make the SumOfInvoiceAmt available in your report's record source without
the ugly DSum().


--
Duane Hookom
MS Access MVP
--

Tina said:
Thanks, that worked but now I have to do it for the rest of my controls.
I
need a total for each one:

I tried the adding another 2 text boxes in the footer section but I don't
get a result:

=Sum(IIf([rpt_GL_Revision subreport].Report.HasData,[rpt_GL_Revision
subreport].Report.SumOfGL,0))

=Sum([Planned Budget]-[SumGL_Amt]+IIf([rpt_GL_Revision
subreport].Report.HasData,[rpt_GL_Revision subreport].Report.SumOfGL,0))

Duane Hookom said:
You could set up a running sum on a control and reference the control
name
in the control source of a text box in your footer. Another method would
be
to use:

=Sum(Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),0))

I think I have suggested to you several time previously that you should
not
use "$0.00 " in your Nz() function.

--
Duane Hookom
MS Access MVP
--

Tina said:
I would also like to add: the text box I created in my detail section
is
called GLAmount and the Control Source is
=Nz(DSum("[InvoiceAmt]","qry_gl_const","[GL_ID] = " & [GL_ID]),"$0.00
")

I now would like the sum of all these amounts. Is there a way to do
this?

:

I don't quite understand what you mean? Are you saying that I can't
get
the
sum of the control from the footer section instead it would have to be
in
the
detail section where the control was created.

What I would like to do is I have a control (text box) in the detail
sectiod
that displays the sum of some fields from a table. Now I would like to
get
the sum of all these amounts. What's the best way of going about
this?

:

You can't sum a control from another section. You can generally sum
the
control source of a control from a different section:
=Sum([Qty] * [UnitPrice])

--
Duane Hookom
MS Access MVP
--

I have a added a text box to the footer of my report and I want to
get
the
total of an another text box in the detail section with a name of
GLAmount.

I tried this and I don't get an aswer when I preview the report.

=Sum([GLAmount])
 
Back
Top