Filter Record Count

J

Joe

I have a form that I want a message box to pop up showing the number of
records in the dataset after a filter is applied (Filter By Selection, Filter
Excluding Selection, Remove Filter/Sort, etc).

I've added the following code to the form:

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
MsgBox Me.Recordset.RecordCount
End Sub

Unfortunately, the message box is displaying the number of records in the
form prior to the filter being applied. How can I get a message box to show
the records after the filter is applied?

Example: lets assume that the form is filtered and only 100 or 500 records
are showing. If I right-click and hit Remove Filter/Sort, the message box
pops up and displays "100". I'd like it to display "500", the record count
after the filter change.

I know I'm missing something easy. Thanks in advance for your help!
 
J

Joe

The Form_ApplyFilter is invoked when I right click on the form and then
select Filter by Selection, Filter Excluding Selection, Remove Filter/Sort,
etc. Each of these essentially results in a filter being applied.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top