title: MS Access Retrieve Values from ListBox
body: <p>UPDATE: 3/20/2019
  After subthread conversation (below), I renamed the ListBox. ItemsSelected property WORKS. Value still returning NULL int he code</p>
  
  <hr>
  
  <p>This is my first time dealing with multi-select lists in Access. I have a report form with some dropdowns, checkboxes, and a listbox. The listbox contains almost 70 items - Let's call them "Cities".</p>
  
  <p>The ListBox allows multiple selections. In VBA, I'm taking each of the parameters - from the other controls on the form, to create a giant WHERE condition that feeds my report.</p>
  
  <p>The problem is that Access is not reading the values selected from the ListBox. When I step through that line of code, the value is NULL.</p>
  
  <p>So far:</p>
  
  <pre><code>Dim s As Variant
  s = Me.City.Value &amp; "" 
  </code></pre>
  
  <p>This is where I know I wrong-turned, but, not having dealt with a multi-select ListBox before, I don't know the syntax to get the values read.</p>
  
  <p>Next: Check for whether or not values are selected in List "s":</p>
  
  <pre><code>If s &lt;&gt; "" Then
  </code></pre>
  
  <p>Check for other parameters in the current WHERE condition. IF none exist, THEN</p>
  
  <pre><code>If c.WhereCondition = "" Then
  c.WhereCondition =
  </code></pre>
  
  <p>Set WHERE Condition by comparing List values (which are Strings) to the Yes/No values of equivalent fields in Source table. </p>
  
  <p>I have to compare the List values to the 70 fields in the table - to pull out those records that match. </p>
  
  <p>No, there's not 1 field - say Cities, with 70 possible values. Instead, each of the 70 possible Cities is its own Yes/No field. I inherited this DB. It's how it was built.</p>
  
  <p>Currently, my attempt at this looks like:</p>
  
  <pre><code>c.WhereCondition = "( City1 = -1 OR City2 = -1 OR City3 = -1 OR .....)
  </code></pre>
  
  <p>`IF there are parameters in the current WHERE clause, THEN compare values in List to Source table, AND APPEND result to WHERE condition with "AND"</p>
  
  <pre><code>ELSE
         c.WhereCondition = c.WhereCondition &amp; " AND (City1 = -1 OR City2 = -1, OR ...)
  
      End If
      End If
  </code></pre>
  
  <p>I hope I was able to explain this well enough. The 1st problem is getting the values read. I won't know if my attempt at comparison is right or wrong without that.</p>