[AccessD] OnApplyFilter event

Bruce Bruen bbruen at bigpond.com
Wed Jul 23 17:05:52 CDT 2003


Heyho listers,

I'm having a spot of bother....  I have a continuous forms subform that
gets filtered in a couple of different ways.  There are two command
buttons that toggle "standard" filters and there are normal toolbar
based filter buttons (Filter by selection, filter by form and filter
excluding selection) available to the user.  The form updates a status
bar panel with the number of records... Or its supposed to anyway. 

When the filter is applied using the command button, the event handler
uses the following to update the status bar:

    Me.Parent.Controls("stbMain").panels(1).Text =
Me.Recordset.RecordCount & " records"

This works fine and dandy - the count displayed is always the number of
FILTERED records.

Applying a toolbar filter however, obviously doesn't natively call this
routine.  So I have implemented a form_ApplyFilter handler to achieve
the desired result, viz

    Me.Parent.Controls("stbMain").panels(1).Text =
Me.Recordset.RecordCount & " records !!!"

I have used a different string PURELY to ensure that the routine does
get called.  It does.  BUT the number of records set is the full record
count i.e. the unfiltered count.

According to the unhelp "The actions in the ApplyFilter macro or event
procedure occur before the filter is applied or removed; or after the
Advanced Filter/Sort, Filter By Form, or Server Filter By Form window is
closed, but before the form is redisplayed."  which explains why I get
the unfiltered count.  

So can anyone tell me how I can get something to run AFTER the DAMN
FILTER has been applied?

Yours in confoundment
Bruce



More information about the AccessD mailing list