I'm joining two tables together. I want to pick one column when their is no data in the other column. One of the feilds is "SumOfHourlykWh" from qdRevenueConsolidatedByHE and the other is "SumOfAverage" from adSCADAConsolidatedByHE.
The function in the new field is: kWh: kWhHE([SumOfHourlykWh],[SumOfAverage])
My VBA code is:
Public Function kWhHE(dRevkWh As Double, dSCADAkWh As Double) As Double
If dRevkWh = "" Then
kWhHE = dRevkWh
Else
kWhHE = dSCADAkWh
End If
End Function
Why is putting #Error in the field KWh?