title: Data type mismatch in criteria expression. MS Access VB
body: <p><p> ' OK button  </p>
  
  <pre><code>Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
      Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=C:\Users\Jill\Desktop\saddbase\Sadsystem\Sadsystem\bin\Debug\tenant.mdb")
      Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM info WHERE TN_ID = '" &amp; UsernameTextBox.Text &amp; "' AND Password = '" &amp; PasswordTextBox.Text &amp; "' ", con)
      con.Open()
      Dim sdr As OleDbDataReader = cmd.ExecuteReader()
      ' If the record can be queried, Pass verification and open another form.  
      If (sdr.Read() = True) Then
          MessageBox.Show("The user is valid!")
  
          Me.Hide()
      Else
          MessageBox.Show("Invalid Tenant ID or password!")
  
  
  End If
  </code></pre>
  
  <p></p>
  
  <p>When I run the program there's an error in cmd.ExecuteReader(). <em>Data type mismatch in criteria expression</em> please help how to fix this error. </p>