By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,702 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,702 IT Pros & Developers. It's quick & easy.

Trying to total a text box in report

P: n/a
Could use some help. I don't know if I can even do whatI'm trying to
do. I have a text box in a report under the details section. It will
return a value for each line on a sepcific record set. There may be 1
line or 10 lines. What I want to do is sum the totals in that text box.
I tried putting the following code in the control source. It dosn't
like it. I don't know if I'm just putiing it in incorrectly or if it
will work at all. Thanks for any help.

DSum ( [SITE TOT] , [Forms]![Camping Receipt]!, <>)

Dec 16 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
On 16 Dec 2005 05:07:14 -0800, "deercreek" <da*@deercreekcg.com>
wrote:

Try this in the control source for the sum field:
=Sum([SITE TOT])

-Tom.

Could use some help. I don't know if I can even do whatI'm trying to
do. I have a text box in a report under the details section. It will
return a value for each line on a sepcific record set. There may be 1
line or 10 lines. What I want to do is sum the totals in that text box.
I tried putting the following code in the control source. It dosn't
like it. I don't know if I'm just putiing it in incorrectly or if it
will work at all. Thanks for any help.

DSum ( [SITE TOT] , [Forms]![Camping Receipt]!, <>)


Dec 16 '05 #2

P: n/a
Yea I already tried that it dosn't work either.

Dec 16 '05 #3

P: n/a
You need to make sure the textbox that contains the formula =Sum([SITE
TOT]) is in a group, page, or report footer.

Dec 16 '05 #4

P: n/a
The text box I am trying to get it to sum in is in report footer, the
text box I'm getting info from is in the details section,
It still dose not work with the above formula.

Dec 16 '05 #5

P: n/a
deercreek wrote:
The text box I am trying to get it to sum in is in report footer, the
text box I'm getting info from is in the details section,
It still dose not work with the above formula.


Did you rename your text boxes when you put them into your report? If
your table/query which is the record source for the report has an actual
field named SITE TOT, then, by default, Access will name any text box
you put into the report based on SITE TOT with the same name.

Click on the text box in the details section.

Open the properties window (alt-enter if not already open)

Check the Data tab and the Control source property - this should be SITE TOT

Now, click on the "Other" tab and check the name. If the Name is SITE
TOT, then this is your source of trouble, Access is getting confused
about which SITE TOT to choose from. Change the name to txtSiteTot or
something different from the control source name.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 16 '05 #6

P: n/a
If i understand the question correctly you are asking if i have the
text box I am trying to total and the text box where i am trying to
place the total are the same name. If that is the question no they are
not same name.

Dec 16 '05 #7

P: n/a
Try renaming the textbox you're summing to something without a space.
Also, to be clear, you're using Sum now instead of DSum, right? Also
take a look at the textbox you're summing to make sure the value inside
is of a numerical persuasion. It only takes one string in a column of
99 numbers to kill the whole summation.

Dec 16 '05 #8

P: n/a

"deercreek" <da*@deercreekcg.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
If i understand the question correctly you are asking if i have the
text box I am trying to total and the text box where i am trying to
place the total are the same name. If that is the question no they are
not same name.


Pardon me for butting in here, but I don't think that's what Tim was saying.
He said to make sure that the name of the text boxes are not the same as the
name of the field in the underlying data source. If the field is [SITE TOT]
make sure the text boxes have different names, such as tbxSite_Tot or
something.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Dec 16 '05 #9

P: n/a
deercreek wrote:
If i understand the question correctly you are asking if i have the
text box I am trying to total and the text box where i am trying to
place the total are the same name. If that is the question no they are
not same name.


No, not quite what I was asking. 8)

Reread what I posted carefully with the following in mind: Does the
text box in the detail section have the same NAME property (my post
tells you how to find this) with the same name, SITE TOT (or whatever is
in the name property) as the CONTORL SOURCE (again, see my last post).

What you are describing is clearly symptomatic of Access getting
confused as to what "SITE TOT" to take into account. This caused me
hours of endless frustration years ago when I was first getting into
Access report writing. 8)

And Tom and Steve are correct as well in that you should be using "Sum"
rather than dsum in the control in the report footer.

Write back if you're still having trouble.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 16 '05 #10

P: n/a
tried all that. My text box i'm trying to sum in the details section
(sitetot) only exists in the form. The text box I am trying to sum into
(text102) in the page footer section. The error I get is Enter
parameter value sittot.

Dec 16 '05 #11

P: n/a
If you're getting a message asking for a parameter value, it's likely
that you have some naming issues.

Try Sum([Forms]![frmNameOfYourForm]!NameOfYourTxtBox) .

Dec 16 '05 #12

P: n/a
now it asks for Reports! etc.I been telling you form Im trying to do
this in a report I don't know if that makes a difference or not. Sorry!

Dec 16 '05 #13

P: n/a
"deercreek" <da*@deercreekcg.com> wrote
The text box I am trying to get it to sum in is in report footer, the
text box I'm getting info from is in the details section,
It still dose not work with the above formula.
You cannot sum a Calculated Control in a Report.

If you have not, make certain that the Text Box displaying the information
you want to Sum does not have the same name as the Control Source (Field in
the RecordSource).

Instead of trying to sum Text Boxes, sum a Field in the underlying
RecordSource.

Read Help again on
DSum ( [SITE TOT] , [Forms]![Camping Receipt]!, <>)


this certainly appears to me to be invalid. DSum works against a Table or
Query ("domain"), it does not work against Fields on a Form. The Criteria is
incomplete, the "<>" means "is not equal" but you haven't specified _what_
is not equal to _what_. I would be very surprised if trying to execute that
DSum function did not generate an error message, unless it was/is used as
Control Source, in which case it might fail silently.

Larry Linson
Microsoft Access MVP

Dec 17 '05 #14

P: n/a
Tim Marshall wrote:
No, not quite what I was asking. 8) Write back if you're still having trouble.


Have you been able to solve your issue, Dan? If you're still having
trouble, don't give up. Sometimes stuff like what we're all suggesting
is hard to see, in fact, I think it would be a really good topic to some
how include on the mvps faq with some screen shots to help folks who are
having difficulty with understanding it. It's something that tripped me
up, personally, for a long time and in the maintenance management
support group I'm involved with that uses Access as a third party
reporting tool against Oracle/MS SQL/Omnis backends, it's a common question.

If you're really frazzled by this, maybe one of us can look at what
you're doing and actually point out what's going wrong. If you want,
(and this is not solicitation for business - it's FREE), figure out my
munged email contact in my contact info on my silly web site below and
we can figure things out from there.

I still think this is a very frequently asked question and should be
some how illustrated on the FAQ.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Dec 18 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.