title: Access - DLookup error for empty fields
body: <p>I have a DLookup function for displaying records from another table. Function works o.k., but problem occurs when there is empty field in the parent record.</p>
  
  <p>Here is my DLookup function :</p>
  
  <pre><code>=DLookUp("Surname";"Employees";"ID_Employees_Table2=" &amp; [Forms]![Company]![Company_Subform].[Form]![ID_Employees_Table1])
  </code></pre>
  
  <p>So, this works when ID_Employees_Table1 field is not empty, but If is "empty" It returns me #Error.</p>
  
  <p>I tried with Nz function like this :</p>
  
  <pre><code>=Nz(DLookUp("Surname";"Employees";"ID_Employees_Table2=" &amp; [Forms]![Company]![Company_Subform].[Form]![ID_Employees_Table1]);0)
  </code></pre>
  
  <p>But Access still returns me #Error in Textbox - where I'm using this function. I've tried also in combination with IsNull, IIf, but both can't stop this #Error from appearing.</p>
  
  <p>How on earth can I stop this error from appearing in my Textbox, please any advices !</p>