A
Alberta Rose
On my report I have a field that I need help with. I have written an =If
statement to try and capture all of the variables, but it is too long, so now
I need to write the same expression in code. Here is what I have in my =If
statement (which resides in the Detail area of the Report):
=IIf([costcode]="013210" And
[costtype]="05320",[txtActualCost]/[txtCraftLabAct],IIf([costcode]="020110"
And
[costtype]="05320",[txtActualCost]/[txtFirewatchLabAct],IIf([costcode]="064201"
And
[costtype]="05320",[txtActualCost]/[txtCraftSuprLabAct],IIf([costcode]="061301"
And
[costtype]="05320",[txtActualCost]/[txtQAQCSuprvLabAct],IIf([costcode]="061101"
And
[costtype]="05310",[txtActualCost]/[txtSiteTeamLabAct],IIf([costcode]="031101"
And
[costtype]="05110",[txtActualCost]/[txtOfficeTeamLabAct],IIf([costcode]="042211"
And [costtype]="05110",[txtActualCost]/[txtEngLabAct],IIf([costcode]="045311"
And
[costtype]="05130",[txtActualCost]/[txtThirdPartyLabAct],IIf([costcode]="032101" And [costtype]="05110",[txtActualCost]/[txtProcurementLabAct],Null)))))))))
So, what it says is check this cost code and cost type and then perform the
calculation of txtActualCost divided by the txt box I've named that
corresponds to the hours for this cost code/cost type that resides in the
Report Header area of the report.
I have tried:
If cost code = 013210 and
costtype = 05320
Then txtActualCost/txtCraftLabHrs
Else
End If
I hope someone can help me with this. The txtActualCost is set as a
currency field, the txtCraftLabHrs is set as standard.
Thanks.
statement to try and capture all of the variables, but it is too long, so now
I need to write the same expression in code. Here is what I have in my =If
statement (which resides in the Detail area of the Report):
=IIf([costcode]="013210" And
[costtype]="05320",[txtActualCost]/[txtCraftLabAct],IIf([costcode]="020110"
And
[costtype]="05320",[txtActualCost]/[txtFirewatchLabAct],IIf([costcode]="064201"
And
[costtype]="05320",[txtActualCost]/[txtCraftSuprLabAct],IIf([costcode]="061301"
And
[costtype]="05320",[txtActualCost]/[txtQAQCSuprvLabAct],IIf([costcode]="061101"
And
[costtype]="05310",[txtActualCost]/[txtSiteTeamLabAct],IIf([costcode]="031101"
And
[costtype]="05110",[txtActualCost]/[txtOfficeTeamLabAct],IIf([costcode]="042211"
And [costtype]="05110",[txtActualCost]/[txtEngLabAct],IIf([costcode]="045311"
And
[costtype]="05130",[txtActualCost]/[txtThirdPartyLabAct],IIf([costcode]="032101" And [costtype]="05110",[txtActualCost]/[txtProcurementLabAct],Null)))))))))
So, what it says is check this cost code and cost type and then perform the
calculation of txtActualCost divided by the txt box I've named that
corresponds to the hours for this cost code/cost type that resides in the
Report Header area of the report.
I have tried:
If cost code = 013210 and
costtype = 05320
Then txtActualCost/txtCraftLabHrs
Else
End If
I hope someone can help me with this. The txtActualCost is set as a
currency field, the txtCraftLabHrs is set as standard.
Thanks.