# Thread: Running a Sum in a Form?!?!

1. Registered User
Join Date
May 2004
Posts
45

## Unanswered: Running a Sum in a Form?!?!

Is there a way to effectively run a Sum of a column in a form?

2. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
=sum(column)

in the form footer

That's making a general assumption that you're using continious forms, since you haven't provided any detail at all about what you actually need to do.

3. Registered User
Join Date
May 2004
Posts
45
Thank you
I will try that right now, to see how it works

Thanks again

4. Registered User
Join Date
May 2004
Posts
45
Well I am using continuous form, every day we count our register, and at the end of the day when we recount it, we input it into the form, and it makes all the calculations for the checks credit cards, and takes all that and subtracts the invoice total from it, to see if we are short or over.
And I would like to put a running total of money collected in the register and invoice totals so we can see how it equals out.

5. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
Right-o, the aformentioned method should do the trick for you then.

Form sections act very similarly to reports, so you can do a lot of the same stuff. Summing columns is one of those similarities.

6. Registered User
Join Date
May 2004
Posts
45
When I put in control source =sum(Invoice Total)
I have a "The Expression you have entered contains a invalid syntax. You may have entered a operand without a operator." error

7. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
=sum([Invoice Total])

Without brackets, the space makes access think you're trying to pass two arguments: Invoice, and then Total to Sum(), it doesn't like that. Brackets identify the entire thing as one field.

8. Registered User
Join Date
May 2004
Posts
45
Thank you very much I have it working. Works pretty good too.

Will this work on a field that has calculations in it. Like I have in my Registers Total field I have =[Pennies]+[Nickels]+ etc... and all that adds up just fine. Will Sum work on that field, or not because it is a calculated field?

9. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
No, you cannot sum a calculated field. You can, however, sum the calculations.

Eg

Sum(pennies + nickels + etc)

10. Registered User
Join Date
May 2004
Posts
45
Thank you very much for replying quickly.
I will have to keep trying on the sum thing. I am very new to this, and it was a wonder that I even was able to get a form running doing what I needed it to do.
I have tried to run a sum in form footer doing the Sum(pennies + nickels + dimes) and it didn't work, and I tried it like =Sum(pennies + + nickels + dimes)
it didn't work,
I also tried =Sum([Pennies]+[Nickels]+[Dimes]) and it didn't work either

I am not sure what I am doing wrong..

11. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
Could you post the underlying query?

12. Registered User
Join Date
May 2004
Posts
45
Well, this my last attempt at trying to figure it out

=Sum([Text72]+[Text74])

this is what I was putting in control source the last time I did it
I left it with the default Text label because it was just a simple form
The other time I tried
=Sum(Text72 + Text74)
Then I tried
Sum(Text72 + Text74)

Then I tried
=Sum([Text72]+[Text74])
I get an #error in the field when I try all these

13. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
Please post the underlying sql query.

14. Registered User
Join Date
May 2004
Posts
45
I apologize for not knowing, but where can I get this query for you?

15. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102