Stopping #Error message with Dlookup formula

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I have a number of controls on a report where the control source is a DLookup
formula. I know that in a number of cases the data that it is finding are
zeroes and I think that's why I'm getting the #Error message. How can I
change my Dlookup to return a zero when the value of the field it is quering
is also zero?
Here is an example of my DLookup formula:
=DLookUp("[Sum Of txtAdvancestot] ","qryFDApage2","[txtmonthlabel]=[txtqtr2]")

Thanks
Tony
 
I do not DLookup syntax but your 'zeros' might not be zero but Nulls.
So try this --
=DLookUp("IIF([Sum Of txtAdvancestot] Is Null, 0, [Sum Of txtAdvancestot])
","qryFDApage2","[txtmonthlabel]=[txtqtr2]")
 
Thanks Karl, I'll try that.
Tony

KARL DEWEY said:
I do not DLookup syntax but your 'zeros' might not be zero but Nulls.
So try this --
=DLookUp("IIF([Sum Of txtAdvancestot] Is Null, 0, [Sum Of txtAdvancestot])
","qryFDApage2","[txtmonthlabel]=[txtqtr2]")

--
Build a little, test a little.


Tony Williams said:
I have a number of controls on a report where the control source is a DLookup
formula. I know that in a number of cases the data that it is finding are
zeroes and I think that's why I'm getting the #Error message. How can I
change my Dlookup to return a zero when the value of the field it is quering
is also zero?
Here is an example of my DLookup formula:
=DLookUp("[Sum Of txtAdvancestot] ","qryFDApage2","[txtmonthlabel]=[txtqtr2]")

Thanks
Tony
 
Back
Top