When I run this code it says "Invalid use of Null", but all my vairables have values...i dont understand what it has got to do with Null...=(
If tmpyr = "Y0" Or bus_type = "FB" Then
r = 0
Else
r = Max(0, DLookup(tmpyr, "CSV_" & bus_type, "Age=" & tmpcnt)) * (1 - fac) + (DLookup(tmpyr2, "CSV_" & bus_type, "Age=" & tmpcnt) + coupon) * fac
End If
If tmpyr = "Y0" Or bus_type = "FB" Then
r = 0
Else
r = Max(0, DLookup(tmpyr, "CSV_" & bus_type, "Age=" & tmpcnt)) * (1 - fac) + (DLookup(tmpyr2, "CSV_" & bus_type, "Age=" & tmpcnt) + coupon) * fac
End If