title: DLookup function not working in subform, MS Access VBA
body: <p>I have a main form "fmEmpHWList2" inside it there are two subforms. In the subform "frmSWList2" I have textfields that I'm using Dlookup functions to get values from a table. 
  When I tested this on the subform alone everything worked. But when I brought the subform into the main form I get the "#Name?" error.</p>
  
  <p>Here is my current code within the mainform that gives me the error and I need to fix:</p>
  
  <pre><code>=DLookUp("Version","EmpSWSum","Software = '7-Zip' AND EmpID=" &amp; [Forms]![fmEmpHWList2]![frmSWList2].[Form]![EmpID])
  </code></pre>
  
  <p>In the subform alone this code works</p>
  
  <pre><code>=DLookUp("Version","EmpSWSum","Software = 'ADG R4i CSDB Client' AND EmpID=" &amp; [Forms]![frmSWList2]![EmpID])
  </code></pre>
  
  <p>Things to note: EmpID is a number</p>
  
  <p>I appreciate your taking the time to help me solve this</p>