title: Access VBA DCount data type mismatch in criteria expression when data types are obviously the same (both Text)
body: <p>I'm doing a simple DCount, just looking for how many people have signed up for the same date and time.  At the moment I'm just using a single date and a single time to prove the process, then I'll have it loop through all possible dates and times.</p>
  <pre><code>Private Sub Get_Singles()
      Dim TestDate As String
      Dim TestTime As String
      AloneCnt = 0
      Dinc = 0
      Tinc = 0
      TestDate = vStartDate
      TestTime = &quot;0700&quot;
      
          If (DCount(&quot;[ID]&quot;, VigilTable, &quot;[fldTime] = &quot; &amp; TestTime) = 1) Then
   '       &quot;[fldDate] = &quot; &amp; TestDate) &amp; &quot; And
          AloneCnt = AloneCnt + 1
      End If
  End Sub
  </code></pre>
  <p>It works fine for the date (I've moved it to a different line and commented it out so I can focus on the time.).</p>
  <p>In the table, fldDate and fldTime are both set for text (shows up as Field Size
  = 255 in the properties list) and, as you can see, TestDate and TestTime are both dimmed as String.</p>
  <p>And it works if I change the DCount line to:</p>
  <p><code>(DCount(&quot;[ID]&quot;, VigilTable, &quot;[fldTime] = '0700'&quot;)</code></p>
  <p>So where's the error?</p>
  <p>Thanks.</p>