Full Version: "#Error" in a controll
UtterAccess Forums > Microsoft® Access > Access Forms
Ankarn
I have a norwegian Access so here it says #Feil which is equivalent to english #Error.
DLookUp("[Mottaker]";"Mottaker";"[MottakerID] =" & Nz(DLookUp("[MottakerID]";"Lagerdata";"[Malernr] = " & [Malernr]))
The problem is that The second Dlookup may not find anything. And when the Malernr doesnt have a MottakerID, i get #Feil In the controll.
I want it to be Null if there is no MottakerID for the Malernr.
Why do i get #Feil and not Null?
Doug Steele
Does it make a difference if you put the value of an ID that doesn't exist inside the Nz function call?
DLookUp("[Mottaker]";"Mottaker";"[MottakerID] =" & Nz(DLookUp("[MottakerID]";"Lagerdata";"[Malernr] = " & [Malernr]),-1))
SerranoG
Your original post is OK because the NZ will give zero if not found and the first DLOOKUP will give NULL of if no IDs of zero are found.
did notice that you're missing a last parenthesis to close out the DLOOKUP.
=DLookUp("[Mottaker]";"Mottaker";"[MottakerID] =" & Nz(DLookUp("[MottakerID]";"Lagerdata";"[Malernr] = " & [Malernr])))
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.