Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing up values from a single textbox.

Status
Not open for further replies.

fiel

Programmer
Jun 3, 2007
96
US
I have a report that will display the cost for 12 different tasks from 1 to 12. If no cost exists for a task, then it's not displayed at all in the report. For each task, a total cost for each Task is seperately listed in a textbox. Is there a way to sum all these totals from the one textbox they are displayed in? I tried doing sum([Text203]), but I get an error saying Text 203 is an invalid field.
 
It sounds like your table is highly un-normalized. However, if you have fields like Fld1, Fld2, Fld3, Fld4 that you want to add together and then sum with the possibility of storing Nulls, try:
Code:
=Sum(Nz(Fld1,0) + Nz(Fld2,0) + Nz(Fld3,0) + Nz(Fld4,0))

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top