Use query data to do a total calculations in a text box on a form.
I have a field in a query that is called Percentages.
i Have a text box that needs to take the information from precentages and total the precentages. I can total a table information is it possible to total a query caluculation in a text box?
=DSum("[Scope]","tblScopeUnit")
Like this some how?
=DSum("[Percentages]","Queryname")
Here is my database
for example
A door installed a=10% b=20% c=30% percentages = 60%
B door installed a=15% b=30% c=20% Percentages = 65%
In the properties box for the form, click the button with three dots next to recordsource.
Then, add a field to the query, and you can have it do the calculations. Once youpen the querybuilder to do that, you should be able to see the names of your fields.
You can sum field directly (Procent fields were changed from text to numeric). Look at sample.
But may be better to use subform with results from query. Dlookups took too many time. MODKitProduction.zip
Jeffrey Coachman
"frmTempleFullUp:Query Builder"
..is that the actual name of the table/query?
Try changing it to something without the special characters...
gigifarrow
ASKER
When I click on the record source to see the the query on the tab it has the name "frmTempleFullUp:Query Builder" .
I dont know how to change it because it doesnt show up as a query,on the Navigation under queries.
I need the total of precentages from a field that is not in the table but was addd to the query.
So when I put,
TotalPrentages:=DSum("[Percentages]","frmTempleFullUp:Query Builder")
error says cant find table or query.
When I go to save it to see what the name of the query is. It ask me if I want to save the record of the SQL statement? it doesnt tell me the name of the query.
Go to the record source box, and click the little button with three dots that you'll see at the right side.
gigifarrow
ASKER
When I click on the record source where the dots are on the right side the query opens up. on the tab it has the name "frmTempleFullUp:Query Builder" .
When I go to save it to see what the name of the query is. It ask me if I want to save the record of the SQL statement? it doesnt tell me the name of the query.
When I put it in a text box I get a error. It seems to me that you cant use DSum with a query but you can use a Dlookup but it doesnt total with a Dlookup. made a new query called qryTemple and tried this.
=DLookUp("[Percentage]","qrytemple"," [Unit ]= ('278th ABCT')") works but doesnt total
=DSum("[Percentage]","qrytemple"," [Unit ]= ('DRS TEST')") gives me a error everytime?