Record Count

access Saudi Arabia
  • 19 years ago

    Can anyone tell me if it is possible to have a text box displaying the record count of a filtered recordset?

  • 19 years ago

    I think u need to do .MoveLast, and then u can use .RecordCount (if you're using ADO)

  • 19 years ago

    if you're using a data from a table in a form, this should work:


    Quote:
     
    Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
       Dim rsTest As Recordset
       Set rsTest = Me.RecordsetClone
       
       rsTest.MoveLast
       txtCount = rsTest.RecordCount
    End Sub


    there is probably a neater way of doing this, and it may well slow your system down if you have got a large recordset.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++ : Where friends have access to your private members.” - Gavin Russell Baker