Nz in a controll

Ankarn

Registered User.
Local time
Today, 13:24
Joined
Jul 4, 2008
Messages
81
=Nz(DLookUp("[Mottaker]";"Mottaker";"[MottakerID] =" & DLookUp("[MottakerID]";"Lagerdata";"[Malernr] = " & [Malernr])))

I tried first without the Nz, but i get #Error in the controll when The Malernr doesnt have any MottakerID.
So the Dlookup inside the forst DLookup doesnt return anything. I doesnt want it to say #Error, i want it to return Null so that it will be blanc.
 
=DLookUp("[Mottaker]";"Mottaker";"[MottakerID] =" & Nz(DLookUp("[MottakerID]";"Lagerdata";"[Malernr] = " & [Malernr]),0))

Does that help?
 
Rather than nesting the DLookup()s, create a query that joins the two tables and use that as the recordsource so you only need a single DLookup(). Domain functions are very "expensive" and two costs twice as much as one:)
 
Which is the same thing I tried to tell Ankarn in another thread he/she started.
 

Users who are viewing this thread

Back
Top Bottom