Dlookup Error

jeran042

Registered User.
Local time
Yesterday, 21:40
Joined
Jun 26, 2017
Messages
127
I have an error that I can use some help on:
I have an unbound textbox that performs a dlookup. The formula looks like this:

Code:
=Replace(Nz(DLookUp("tblInvoiceLog.NOTES","tblInvoiceLog","[VOUCHER_NUMBER]= " & [txtADJ_POLICY] & ""),""),Chr(13) & Chr(10)," ")
This works fine until there is no [VOUCHER_NUMBER] to look up. I then get a #Type! Error.

I would have thought that the Nz would negate this error (apparently I am wrong).

What can I do mitigate the error so I don’t see the #Type! Error
 
You can also wrap the field reference in the Nz() function:

Nz([txtADJ_POLICY], 0)
 
That seems to do it, however, probably unrelated, but I now see a "#Size!" error? Any additional advice?
 
Just when there's no value? I'd start with just the lookup, and add the replace once that works reliably.
 

Users who are viewing this thread

Back
Top Bottom