title: Access VBA Test for Null in Date Field
body: <p>I'm trying to write  a VBA script to restrict what is displayed in a list box on a form in Access 2010.</p>
  
  <p>I've boiled down the situation to reduce the number of opportunities for problems so this is a simplified version of what I'm doing</p>
  
  <pre><code> strMedicaid = "[MCO] = 'Amerigroup' AND [DateAssigned] Is Null"
  
  
   Me.lstMedicaid.RowSource = "SELECT DISTINCT tblSamples.MedicaidNumber " &amp; _
                          "FROM tblSamples " &amp; _
                          "WHERE " &amp; strMedicaid &amp; _
                          "ORDER BY tblSamples.MedicaidNumber;"
  </code></pre>
  
  <p>DateAssigned is a Date Field. The code returns nothing. No results.</p>
  
  <p>If I do just "[MCO] = 'Amerigroup'" I get the expected results so that's not the problem.</p>
  
  <p>I've tried 'Null'. I've tried 'Is Null'. No difference.</p>
  
  <p>If I go into the Access Query builder and build the SQL below:</p>
  
  <pre><code> SELECT tblSamples.MCO, tblSamples.DateAssigned
   FROM tblSamples
   WHERE (((tblSamples.MCO)="Amerigroup") AND ((tblSamples.DateAssigned) Is Null));
  </code></pre>
  
  <p>It works. I get the results I want/expect.</p>
  
  <p>Please help me out with getting the VBA to return the same results I get through the query builder. Thanks in advance.</p>