The layout of the tables are as such:
_______________________
Code of Accounts table:
Proj#/Var#/CodeofAccount/ManPower/Hours/Dollars
Variance table:
Proj#/Var#/MaterialCost/EquipCost/ConstructCost/StaffCost (+ Many others not related to this issue)
________________________
The Variance table is the main table. I've got a multi primary key with Proj# and Var#. I've put the Code of Accounts in a different table because, for every variance record there can be multiple code of account records.
What I'm wanting to do is add the sum of the Dollars from Code of Accounts table to the Sum of MaterialCost + EquipCost + ConstructCost + StaffCost in the Variance table and show it in a field(called Totals) on a form. I would like to do this in a query.
--What I've tried already was this: A totals query(QryCOA) of CodeofAccounts table which sums all the Dollars fields for each Proj# & Var# into a field called COATotals. I'm only showing Proj# (Group By)/ Var# (Group By)/ COATotals: Dollars (Sum).
--Then I created a query(QryVariance) with all fields from Variance Table then using the zoom I add MaterialCost + EquipCost + ConstructCost + StaffCost into field called VARTotals. The into Totals field I add COATotals + VARTotals. I'm showing Variance.* / VARTotals (MaterialCost + EquipCost + ConstructCost + StaffCost) / Totals (VARTotals + COATotals)
This gets the correct values with no problem. The issue I have is that it won't allow me to edit any of the fields in the query. I removed the QryCOA from the select and it allows me edit the records. It is probably because QryCOA is a Totals query summing the Dollars that I can't edit the records.
The end result I'm wanting:
I have a Variance Form and a Subform CodeofAccounts. I'm wanting to show the Totals field on the Variance form. I will also use the Totals field on reports and such. This is why I would like it to be in a query.
Any suggestion?
Thanks,
Eric
_______________________
Code of Accounts table:
Proj#/Var#/CodeofAccount/ManPower/Hours/Dollars
Variance table:
Proj#/Var#/MaterialCost/EquipCost/ConstructCost/StaffCost (+ Many others not related to this issue)
________________________
The Variance table is the main table. I've got a multi primary key with Proj# and Var#. I've put the Code of Accounts in a different table because, for every variance record there can be multiple code of account records.
What I'm wanting to do is add the sum of the Dollars from Code of Accounts table to the Sum of MaterialCost + EquipCost + ConstructCost + StaffCost in the Variance table and show it in a field(called Totals) on a form. I would like to do this in a query.
--What I've tried already was this: A totals query(QryCOA) of CodeofAccounts table which sums all the Dollars fields for each Proj# & Var# into a field called COATotals. I'm only showing Proj# (Group By)/ Var# (Group By)/ COATotals: Dollars (Sum).
--Then I created a query(QryVariance) with all fields from Variance Table then using the zoom I add MaterialCost + EquipCost + ConstructCost + StaffCost into field called VARTotals. The into Totals field I add COATotals + VARTotals. I'm showing Variance.* / VARTotals (MaterialCost + EquipCost + ConstructCost + StaffCost) / Totals (VARTotals + COATotals)
This gets the correct values with no problem. The issue I have is that it won't allow me to edit any of the fields in the query. I removed the QryCOA from the select and it allows me edit the records. It is probably because QryCOA is a Totals query summing the Dollars that I can't edit the records.
The end result I'm wanting:
I have a Variance Form and a Subform CodeofAccounts. I'm wanting to show the Totals field on the Variance form. I will also use the Totals field on reports and such. This is why I would like it to be in a query.
Any suggestion?
Thanks,
Eric