Actually, you can use the Replace function is an IIF() function.
I don't understand your criteria, but this does not error for me:
Code:
=IIf(DCount("*","[Contacts Extended]","[ID]<>" & Nz([ID],0) & " And [Contact Name] = '" & Replace(Nz([Contact Name],""),"'","''") & "'")>0,"Possible Duplicate","")
What is "ID"? Usually a field named "ID" is a PK field which is unique. There would only be 1 record.
And why are you using "<>" (not equal to)????? To find "Possible Duplicate", I would think you would want to use "=" (equals).