Dlookup #Error Annoyance

Swillsy

Registered User.
Local time
Today, 10:46
Joined
Jun 10, 2008
Messages
68
Hi peeps

I have several dlookup expressions on my forms looking up values in other tables which work fine.

My only problem is if they cannot find a value becuase it isnt there for the odd record i get an unsightly #error message in the box.

Is there anyway of stopping access displaying this as it is annoying - I have been trying iif etc but to no avail.

Here is my current query:

=DLookUp"[Address_Line_1]","tblStudentsAddresses_Current_All","[Person_Code] = " & Forms!Applicantsdata1!Person_code & "")

Cheers

Swillsy
 
Try with NZ function.
= Nz(Dlookup...........),0
 
use the Nz function to set a value when you're not sure what might come back.

=Nz(DLookUp("[Address_Line_1]","tblStudentsAddresses_Current_All","[Person_Code] = " & Forms!Applicantsdata1!Person_code & ""),"")
 

Users who are viewing this thread

Back
Top Bottom