Stopping #Error message with Dlookup formula

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
 
K

KARL DEWEY

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]")
 
T

Tony Williams

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

IIf function Problem 4
Error in Dlookup formula 2
Yet another DLookup problem! 5
Problem with DLookup 8
dlookup #error 2
dlookup runtime error 3075 1
Dlookup #error #name 4
Dlookup - blank record 2

Top