NC,
I am confused by your use of text box and field. A field is a column in a table or query. A text box is a control on a form or report.
You can't sum a control from one section of a report to another. For instance if you have a text box in the detail section of your report:
Name: txtTotalCost
Control Source: =[Qty] * [Price]
You can't add a text box in any header or footer with a control source of:
=Sum(txtTotalCost)
You can set the control source to:
=Sum([Qty] * [Price])
BTW: [blue]Value[/blue] is not a good name for either a field or a control. [blue]Value[/blue] is a property of most bound controls and other objects.
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]
How do you create a total field for the following scenario. I am creating a costing sheet based on qty_sold * unit_cost giving value. If none are sold then the value will be 0. I thought about suming the unit costs and on the total line multiplying them by the quantity sold. This only works if all line items have a sold quantity beside them.
I'm not sure what would be wrong if you used:
=Sum(qty_sold * unit_cost)
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]
Still not sure. I have a report that is grouped by customer. I have a number of detail lines per customer. I have a text box in the detail line that is
=[unitCost] * [SoldQty]
This gives me the correct total in the detail line. In the footer for each customer I want to get a total value for all the detail lines.
Did you try my suggestion? Did it work? If not, why not?
Did you really want the total for all detail lines or just for the one customer group?
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]
Isn't the [blue]65.00[/blue] value what you want to display in the customer footer? Is your [blue]Footer[/blue] the customer footer or another footer?
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]
Did you try display the customer footer and add a text box with a control source of:
=Sum([unitCost] * [SoldQty])
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]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.