Calculated field in main form

  • Thread starter Thread starter MsDYJ
  • Start date Start date
M

MsDYJ

I have a main form with several subforms connected to it. 1 of the subforms
shows the material cost and the qty. used. Another subform shows the price of
a resource and the hours worked. I want the actual cost field in the main
form to display the total of the sum of all the material costs and the sum of
all the resource cost.

I used an unbound textbox and in the control source used the formula:
=Sum(MaterialCost*QTY) + Sum(ResourceCost*HrsWorked)and some other formulas
but keep getting an error. Does any one have any suggestions?
Thanks
 
but keep getting an error.
You did not say what the error is.
Try this --
=([MaterialCost]*[QTY]) + ([ResourceCost]*[HrsWorked])
 
#error, that's what the fomula keeps giving me. So I decided to get my
material and resource totals within in the respective subforms, which worked.

From there I went to the main form and attempted to add those to sums.
=MaterialTotal + ResourceTotal

Now i'm getting an #Name? error.

KARL DEWEY said:
You did not say what the error is.
Try this --
=([MaterialCost]*[QTY]) + ([ResourceCost]*[HrsWorked])

--
Build a little, test a little.


MsDYJ said:
I have a main form with several subforms connected to it. 1 of the subforms
shows the material cost and the qty. used. Another subform shows the price of
a resource and the hours worked. I want the actual cost field in the main
form to display the total of the sum of all the material costs and the sum of
all the resource cost.

I used an unbound textbox and in the control source used the formula:
=Sum(MaterialCost*QTY) + Sum(ResourceCost*HrsWorked)and some other formulas
but keep getting an error. Does any one have any suggestions?
Thanks
 
#Name? means Access does not recognize the field.
Use this --
= [Forms]![YourMainFormName]![YourSubFormName]![MaterialTotal] +
[Forms]![YourMainFormName]![YourSubFormName]![ResourceTotal]

--
Build a little, test a little.


MsDYJ said:
#error, that's what the fomula keeps giving me. So I decided to get my
material and resource totals within in the respective subforms, which worked.

From there I went to the main form and attempted to add those to sums.
=MaterialTotal + ResourceTotal

Now i'm getting an #Name? error.

KARL DEWEY said:
but keep getting an error.
You did not say what the error is.
Try this --
=([MaterialCost]*[QTY]) + ([ResourceCost]*[HrsWorked])

--
Build a little, test a little.


MsDYJ said:
I have a main form with several subforms connected to it. 1 of the subforms
shows the material cost and the qty. used. Another subform shows the price of
a resource and the hours worked. I want the actual cost field in the main
form to display the total of the sum of all the material costs and the sum of
all the resource cost.

I used an unbound textbox and in the control source used the formula:
=Sum(MaterialCost*QTY) + Sum(ResourceCost*HrsWorked)and some other formulas
but keep getting an error. Does any one have any suggestions?
Thanks
 
Yes! It worked. Thank you so very much. You've been a huge help.

KARL DEWEY said:
#Name? means Access does not recognize the field.
Use this --
= [Forms]![YourMainFormName]![YourSubFormName]![MaterialTotal] +
[Forms]![YourMainFormName]![YourSubFormName]![ResourceTotal]

--
Build a little, test a little.


MsDYJ said:
#error, that's what the fomula keeps giving me. So I decided to get my
material and resource totals within in the respective subforms, which worked.

From there I went to the main form and attempted to add those to sums.
=MaterialTotal + ResourceTotal

Now i'm getting an #Name? error.

KARL DEWEY said:
but keep getting an error.
You did not say what the error is.
Try this --
=([MaterialCost]*[QTY]) + ([ResourceCost]*[HrsWorked])

--
Build a little, test a little.


:

I have a main form with several subforms connected to it. 1 of the subforms
shows the material cost and the qty. used. Another subform shows the price of
a resource and the hours worked. I want the actual cost field in the main
form to display the total of the sum of all the material costs and the sum of
all the resource cost.

I used an unbound textbox and in the control source used the formula:
=Sum(MaterialCost*QTY) + Sum(ResourceCost*HrsWorked)and some other formulas
but keep getting an error. Does any one have any suggestions?
Thanks
 
Back
Top