Problem with Dlookup field returning #Error

mardi 17 mars 2015

I have a couple of Dlookup fields in my report that keep returning #Error.

I've tried this two different ways, both of which fail.



=Nz(DLookUp("[FirstName] & ' ' & [LastName]","dbo_client_contacts","ID = " & [PersonID]),"")



=DLookUp("[FirstName] & ' ' & [LastName]","dbo_client_contacts","ID = " & Nz([PersonID],0))



The field PersonID is a numeric field. ID is a numeric field with FirstName and LastName corresponding to it. If there is a value for PersonID, both of these formulas work wonderfully. The problem is, if there is no value in the PersonID field, it returns #Error



I want it to just leave the field blank, I don't need to know it is an error, this is just a field for "Is there a person assigned to this and if so, who" field. In the event of no one assigned to it, it should just remain empty.



I've struggled too long to not ask for insight/help on trying to resolve this issue. :banghead:

Problem with Dlookup field returning #Error

0 commentaires:

Enregistrer un commentaire

Labels