By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

how many records are being displayed

P: 59
Good week everyone !

I made a botton that changes the form filter.
I want to display how many records are being displayed after the new filter, is there a way to retrieve it ?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Refilter_Click()
  2.         strFilter = "[ReferredBy] = '" & Me.Ref.Value & "'"
  3.         Me.Filter = strFilter
  4.         Me.FilterOn = True
  5. End Sub
  6.  
Me.LSum.Value = ?

thanks in advance, Idan
Feb 2 '08 #1
Share this Question
Share on Google+
3 Replies


FishVal
Expert 2.5K+
P: 2,653
Hi, Idan.

You may use something like the following:
Expand|Select|Wrap|Line Numbers
  1. Dim rs As DAO.Recordset
  2. Set rs = Me.RecordsetClone    ' get clone of the form's recordset
  3. rs.MoveLast                  ' to force the recordset to count all the records
  4. Me.LSum.Value = rs.RecordCount
  5. Set rs = Nothing
  6.  
Regards,
Fish
Feb 2 '08 #2

P: 59
thanks FishVal ! :) its exactly what I needed.

Hi, Idan.

You may use something like the following:
Expand|Select|Wrap|Line Numbers
  1. Dim rs As DAO.Recordset
  2. Set rs = Me.RecordsetClone    ' get clone of the form's recordset
  3. rs.MoveLast                  ' to force the recordset to count all the records
  4. Me.LSum.Value = rs.RecordCount
  5. Set rs = Nothing
  6.  
Regards,
Fish
Feb 4 '08 #3

FishVal
Expert 2.5K+
P: 2,653
Not a problem.
Good luck.
Feb 4 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.