Snowflake68
Registered User.
- Local time
- Today, 21:22
- Joined
- May 28, 2014
- Messages
- 464
I have multiple text boxes on a form that are bound to different costs field in a table. I want to be able to sum all of the cost fields into one Grand Total field without having to explicitly write out each field in a query to total them all up.
Is there a way of using the Tag property to identify each of the text boxes that I want to sum up and then possibly loop through them to sum up the total into another text box that is bound to the same table?
At the moment I have an update query that runs to update the total for 10 of the costs but I have another 50 or so to add so the query is becoming cumbersome to amend.
This is the SQL from my current query
Is there a way of using the Tag property to identify each of the text boxes that I want to sum up and then possibly loop through them to sum up the total into another text box that is bound to the same table?
At the moment I have an update query that runs to update the total for 10 of the costs but I have another 50 or so to add so the query is becoming cumbersome to amend.
This is the SQL from my current query
Code:
UPDATE tblMain SET tblMain.QuoteTotal = Nz([HeatCost])+Nz([PlaceCost])+Nz([CoverCost])+Nz([Expenses])+Nz([TypeTotal])+Nz([FurnitureTotal])+Nz([LaundryTotal])+Nz([PrintTotal])+Nz([ScreenTotal])+Nz([DeliveryTotal]);