Qn on Null with DLookup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have read a number of posts but can't seem to find the exact situation I am
facing...and it is probably a minor issue.

I want to return a value from one query if available, else return a value
from another query...I tried:

=Nz(DLookUp("Plan","QryWeeklyMarshTotals","WeekNumTracker = 'Week - 1'
"),DLookUp("Plan","QryWeeklyMarshTotals","WeekNum = 'Week - 1' "))

but it returns and Error. Is it possible to use Nz and not simply return a
"0" or "", and actually get a value that definitely exists in another
location?

Appreciate any help on this.

M
 
Yes, it is possible for Nz to return other values. However, I suspect the
error may be in the WHERE part of the DLookup.

"WeekNum = 'Week - 1' "

Is this supposed to be a number? If so, you don't need the single quotes.
Where does the value Week come from?
 
Monish said:
I have read a number of posts but can't seem to find the exact situation I am
facing...and it is probably a minor issue.

I want to return a value from one query if available, else return a value
from another query...I tried:

=Nz(DLookUp("Plan","QryWeeklyMarshTotals","WeekNumTracker = 'Week - 1'
"),DLookUp("Plan","QryWeeklyMarshTotals","WeekNum = 'Week - 1' "))

but it returns and Error. Is it possible to use Nz and not simply return a
"0" or "", and actually get a value that definitely exists in another
location?


Your idea is valid. Did you try using those DLookups by
themselves without the confusion of the Nz? I suspect that
the criteria 'Week - 1' is not right.
 
Back
Top