title: MS Access query with parameter from combobox in form does not return any results
body: <p>I have created an MS Access database with several tables and queries but the problem described further down is about the following:</p>
  
  <ul>
  <li><p><em>tEmployee</em> table contains employee data as the name implies.</p></li>
  <li><p><em>tCases</em> table contains data about court cases.</p></li>
  <li><p>Each case can be assigned to only one employee. I have created a relationship from <code>[tCases]![assignedTo]</code> field to <em>tEmployee</em>.</p></li>
  <li><p><em>fSearches</em> is a form to perform searches among the cases. It includes a combobox <em>cEmployee</em> which is populated from <code>[tEmployee].[surname]</code> and a command button to perform the search.</p></li>
  </ul>
  
  <p><strong>GOAL</strong>: to select employee in <code>[fSearches]![cEmployee]</code>, hit the button and show all the cases assigned to this employee in another form named <em>fResultsCases</em>.</p>
  
  <p>This is the code for the button where lines in comments are some of the things I've tried:</p>
  
  <pre><code>If cEmploee.ListIndex = -1 Then
       MsgBox "You have to select employee to perform search.", title:="Missing value!"
  Else
       tHidden2.SetFocus
       tHidden2.Text = "assigned to " &amp; cEmploee &amp; "."
       DoCmd.OpenForm "fResultsCases"
  
       'Forms("fResultsCases").RecordSource = "SELECT * FROM tCases WHERE [tCases]![assignedTo] like [Forms]![fSearches]![cEmploee];"
  
       'Forms("fResultsCases").RecordSource = "SELECT * FROM tCases WHERE tCases .[assignedTo] = [Forms]![fSearches]![cEmploee];"
  
       Forms("fResultsCases").RecordSource = "SELECT * FROM tCases WHERE [assignedTo] = [Forms]![fSearches]![cEmploee];"
  
       Forms("fResultsCases").Recalc
  End If
  </code></pre>
  
  <p>With all the above mentioned I get the following: </p>
  
  <ul>
  <li><p><code>[fResultsCases]</code> opens but does not return any case.</p></li>
  <li><p>I tried to omit the <code>WHERE</code> clause and <code>[fResultsCases]</code> returns all cases as expected.</p></li>
  <li><p>Then I tried to narrow things down to understand the problem by creating a simple query with one parameter and got exactly the same results. </p>
  
   <pre class="lang-sql prettyprint-override"><code>SELECT tCases.[case number], tCases.subject, tCases.fromDt, tCases.toDt, 
         tCases.assignedTo, tCases.[date assigned], tCases.[date completed]
  FROM tCases
  WHERE (((tCases.assignedTo)=[Forms]![fSearches]![cEmploee]));
  </code></pre></li>
  </ul>
  
  <p>It seems like I'm missing something about the <code>WHERE</code> clause when it comes to combobox values but I can't figure it out. I am new to MS Access. Any help will be very appreciated.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p><em>cEmploee rowsource property</em>:  <code>SELECT [tEmployee].surname FROM tEmployee ORDER BY [surname];</code> </p>
  
  <p><em>cEmploee bound column property</em>:  1</p>