Hi there,
I have the following problem which I do not get to work:
I need to calculate commission and I dim a variable which I want to set to a table column, however this does not work. BUT the entire calculation works, if I declare the variable but do not reference a table column but rather a simple number:
=============================
=============================
THIS works (part of code only)
==============================
strsratebelow60 = "0" '=
strsrate60to80 = "0.02" '=
strsrate80to100 = "0.04" '=
strsrateabove100 = "0.06" '=
'===========================
strservice = "Iif(MonthlyPerformance < 0.6, " & strsratebelow60 & ", " _
& "Iif(MonthlyPerformance < 0.8, (MonthlyServiceRevenue* " & strsrate60to80 & " ), " _
& "Iif(MonthlyPerformance < 1,(MonthlyServiceRevenue* " & strsrate80to100 & " ), " _
& "Iif(MonthlyPerformance >= 1,(MonthlyServiceRevenue* " & strsrateabove100 & " ), " & strsratebelow60 & " ))))"
THIS DOES NOT works (part of code only)
=======================================
strsratebelow60 = "tblServiceRates.Below60Rate" '=
strsrate60to80 = "tblServiceRates.60to80Rate" '=
strsrate80to100 = "tblServiceRates.80to100Rate" '=
strsrateabove100 = "tblServiceRates.Above100Rate" '=
'===========================
strservice = "Iif(MonthlyPerformance < 0.6, " & strsratebelow60 & ", " _
& "Iif(MonthlyPerformance < 0.8, (MonthlyServiceRevenue* " & strsrate60to80 & " ), " _
& "Iif(MonthlyPerformance < 1,(MonthlyServiceRevenue* " & strsrate80to100 & " ), " _
& "Iif(MonthlyPerformance >= 1,(MonthlyServiceRevenue* " & strsrateabove100 & " ), " & strsratebelow60 & " ))))"
=======================
=======================
I tried endless combinations of '&' and '"' around the variables but do not get it to work.
Any help would be greatly appreciated.
Many thanks
I have the following problem which I do not get to work:
I need to calculate commission and I dim a variable which I want to set to a table column, however this does not work. BUT the entire calculation works, if I declare the variable but do not reference a table column but rather a simple number:
=============================
=============================
THIS works (part of code only)
==============================
strsratebelow60 = "0" '=
strsrate60to80 = "0.02" '=
strsrate80to100 = "0.04" '=
strsrateabove100 = "0.06" '=
'===========================
strservice = "Iif(MonthlyPerformance < 0.6, " & strsratebelow60 & ", " _
& "Iif(MonthlyPerformance < 0.8, (MonthlyServiceRevenue* " & strsrate60to80 & " ), " _
& "Iif(MonthlyPerformance < 1,(MonthlyServiceRevenue* " & strsrate80to100 & " ), " _
& "Iif(MonthlyPerformance >= 1,(MonthlyServiceRevenue* " & strsrateabove100 & " ), " & strsratebelow60 & " ))))"
THIS DOES NOT works (part of code only)
=======================================
strsratebelow60 = "tblServiceRates.Below60Rate" '=
strsrate60to80 = "tblServiceRates.60to80Rate" '=
strsrate80to100 = "tblServiceRates.80to100Rate" '=
strsrateabove100 = "tblServiceRates.Above100Rate" '=
'===========================
strservice = "Iif(MonthlyPerformance < 0.6, " & strsratebelow60 & ", " _
& "Iif(MonthlyPerformance < 0.8, (MonthlyServiceRevenue* " & strsrate60to80 & " ), " _
& "Iif(MonthlyPerformance < 1,(MonthlyServiceRevenue* " & strsrate80to100 & " ), " _
& "Iif(MonthlyPerformance >= 1,(MonthlyServiceRevenue* " & strsrateabove100 & " ), " & strsratebelow60 & " ))))"
=======================
=======================
I tried endless combinations of '&' and '"' around the variables but do not get it to work.
Any help would be greatly appreciated.
Many thanks