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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Yet another DLookup problem! 5
Error in Dlookup formula 2
dlookup #error 2
Access ACCESS DLOOKUP INVALID USE OF NULL 0
IIf function Problem 4
Dlookup - blank record 2
Problem with DLookup 8
DLookup problem 3

Back
Top