Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals in the footer

Status
Not open for further replies.

GBall

Programmer
May 23, 2001
193
GB
Hi, I have a textbox with the following code. It works out the unit cost of an operation on an item and displays the correct answer. Given that a process could have several operations to complete, I want to put the final unit cost in the footer of my form.
I have added a textbox with the controlsource set as per the second piece of code.
It, however, doesn't work and I just get #error in the box.
Working Code:
=IIf([Est_Machine_Setup_Time]>0,[Est_Machine_Setup_Time]*[Machine_Setup_Cost_Per]/[quantity],0)+IIf([Est_Machine_Time]>0,[Est_Machine_Time]*[Machine_cost_per]/[quantity],0)+IIf([Est_Resource_Time]>0,[Est_Resource_Time]*[Resource_Cost_Per]/[quantity],0)+IIf([External_Resource_Cost]>0,[External_Resource_Cost]/[quantity],0)
Non-Working code:
=Sum(IIf([Est_Machine_Setup_Time]>0,[Est_Machine_Setup_Time]*[Machine_Setup_Cost_Per]/[quantity],0)+IIf([Est_Machine_Time]>0,[Est_Machine_Time]*[Machine_cost_per]/[quantity],0)+IIf([Est_Resource_Time]>0,[Est_Resource_Time]*[Resource_Cost_Per]/[quantity],0)+IIf([External_Resource_Cost]>0,[External_Resource_Cost]/[quantity],0))

all help appreciated, my thanks in advance.
Regards,
Graham
 
Just to check one thing :

When u create a form and drag the fields from the field list onto the form the names of the boxes by default are the same as the field name that you are dragging. EG if u drag the field COST from the field list on to the form the name of the box is also COST. If you then try to total this it gets confused as to what u r trying to total the boxs or the field in the table. IS this the case on ur form. If so rename the boxes to something else and ammend ur total to suit.

Hope this helps
 
Thanks, that sorted it. Regards,
Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top