469,632 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

Sum of text boxes in a report

76
Hello,

I have a report and am having a hard time summing some numbers. In the detail section of the report, I have 2 text boxes that have IIF statements in them. These IIF statements return numbers, either a positive number or 0. In the Name Footer, I am trying to sum all the occurrances of Text18 and Text19, the two IIF text boxes in the detail. I type =sum([Text18]), but when I run the report, I am first prompted with a pop-up text box with the heading "Text18" and a space to enter text.

Why is it doing this and how can I fix it?

Thanks for all you help and everything you guys do,

Charlie
Nov 16 '06 #1
4 3873
nico5038
3,080 Expert 2GB
The easy solution is to move the IIF statement into your report query so it gets a fixed fieldname.
In the footer (of a group or the page/report footer) you can add a new field with as controlsource:
=Sum(fieldname)

This is the most secure way.

Nic;o)
Nov 16 '06 #2
ckpoll2
76
Thanks for your response.

I'm not sure I understand. I already have criteria in the report query. That criteria will return Type and Hours. There will be a list of different types like APC, CLIN, Overtime, etc. It will also show the number of hours for each type. What the IIF statements do is break out Overtime and Credit Hours, one IIF statement each, from the list with the criteria of if it's Overtime or Credit Hours, return the number of hours, otherwise return 0. It's these numbers or 0's that I need to sum but keep running into the problem identified above.

Any ideas?
Nov 16 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
The simple answer is you cannot sum on calculated controls in Access reports.

As Nico said if you put these IIf statements in as part of your query you will have better control.

Post the full sql for the query you are currently using as the record souce for this report and also the full IIf statements and we will do what we can to help.

Hello,

I have a report and am having a hard time summing some numbers. In the detail section of the report, I have 2 text boxes that have IIF statements in them. These IIF statements return numbers, either a positive number or 0. In the Name Footer, I am trying to sum all the occurrances of Text18 and Text19, the two IIF text boxes in the detail. I type =sum([Text18]), but when I run the report, I am first prompted with a pop-up text box with the heading "Text18" and a space to enter text.

Why is it doing this and how can I fix it?

Thanks for all you help and everything you guys do,

Charlie
Nov 16 '06 #4
nico5038
3,080 Expert 2GB
Also make sure you use the NZ() function for fields in your query that might hold Null as a value like:

SELECT NZ(FieldNum) as NewFieldnum,...

Nic;o)
Nov 16 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jayjay | last post: by
7 posts views Thread by Mark | last post: by
4 posts views Thread by Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post: by
6 posts views Thread by noe1818 via AccessMonster.com | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.