Calculated field in main form

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
 
K

KARL DEWEY

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

MsDYJ

#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
 
K

KARL DEWEY

#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
 
M

MsDYJ

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top