Getting the record count after applying/removing filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know how to get the record count of a datasheet
(Form.RecordsetClone.RecordCount). So now what I want to do is get the
recordcount after the user has applied a filter. I am aware of the
applyfilter event that fires when a user applies a filter but the recordcount
does not update until AFTER the event is complete. And conversly how do I get
the updated recordcount when the user removes the filter?

Thx in advance.
 
If I understood you corectly, you want to get the count of records before you
apply a filter or remove the filter.
In that case use the dcount function to return the number of records.
The sub form have a recordsource and you know what the filter, so use it to
get the count of records
dcount("*", "MyTable", Filter)
 
You can also do the following:

Add a textBox to your form with its recordsource to =Count(*).

This is not so fast, but it will give you always the RecordCount of the
displayed RecordSet.
 
Back
Top