title: Data type mismatch help MS Access VBA
body: <p>I keep getting a Data type mismatch when trying to run a lookup. I have a table tWorkOrder and has a Short Text column salesOrderNo Number column workOrderNo and  Short Text lineKey I am searching for the lineKey value in my lookup.</p>
  
  <pre><code>    Dim lineKeyOW, SoNo, WTSo As String
      SoNo = 0135487
      WTSo = 2
      lineKeyOW = Nz(DLookup("lineKey", "tWorkOrder", "salesOrderNo = '" &amp; soNo &amp; "' AND workOrderNo = '" &amp; WTSo &amp; "'"), "NA") 
  </code></pre>