title: I want get the numbers of records with a criteria from a bd access
body: <p>Hi I just need to include the criteria = <em>RS</em> somewhere in the field SEG_OPE_REMARQ from the AQ_SEG table in ACCESS</p>
  
  <p>I just need to get the RS part</p>
  
  <p>Everything in the rest of the code work fine</p>
  
  <pre><code>Sub GetNumbersSigeqR()
  
          'Get Retrait SIGEQ de AQ_SEG_EPEL_XX.mdb.mdb
  
  
      Dim mrc As String
      Dim retrait As String
  
      mrc = Val(Range("D2").Value)
  
      If Len(mrc) &lt; 2 Then
  
          mrc = "0" + mrc
  
      End If
  
  
      retrait = "AQ_SEG_EPEL_" + mrc + ".mdb"
  
      Dim folderPath As String
      folderPath = Application.ActiveWorkbook.Path
  
      Dim cn As Object
      Dim rs As Object
      Dim strSql As String
      Dim strConnection As String
      Set cn = CreateObject("ADODB.Connection")
  
  
      strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; "Data Source=" &amp; folderPath &amp; "\" &amp; retrait
      strSql = "SELECT Count(*) FROM AQ_SEG ;"
      cn.Open strConnection
      Set rs = cn.Execute(strSql)
      Sheets("T9Cp1").Range("G97").Value = rs.Fields(0)
      rs.Close
      Set rs = Nothing
      cn.Close
      Set cn = Nothing
  
  
  End Sub
  </code></pre>