[AccessD] trying to filter a form on a control's value

Bill Benson bensonforums at gmail.com
Sat Dec 27 20:18:26 CST 2014


Hi Gustav and happy holiday week.

I can't set the filter on form load because the items being filtered on (on
demand) are company id's in 3 different combo boxes. I just have to reset
the filter in the afterupdate event for the combos, testing first to make
sure the filter toggle is true at such time... and also to reset the filter
when a toggle click results in its changing state from false to true. I had
just (through inexperience with how to assign things to a filter in code),
sillily thought that I could "set and forget" -- i.e., tie to the combos
once and for all. Like making a controlsource for a filter. Apparently the
filter property does not behave the way I was thinking it ought but it is
no big deal. Living in a dream world where computers do what I want -- not
the real world.


On Sat, Dec 27, 2014 at 5:01 PM, Gustav Brock <gustav at cactus.dk> wrote:

> Hi Bill
>
> If this is your problem, just set (or remove) filters by code when you
> open the form.
>
> Also, I think all of us have to look up items regularly.
>
> /gustav
>
> ________________________________________
> Fra: accessd-bounces at databaseadvisors.com <
> accessd-bounces at databaseadvisors.com> på vegne af Bill Benson <
> bensonforums at gmail.com>
> Sendt: 27. december 2014 21:59
> Til: Access Developers discussion and problem solving
> Emne: Re: [AccessD] trying to filter a form on a control's value
>
> I have used filters sometimes in the past, and the way they interact with
> filteron, their picky syntax, the inability to set and forget them, because
> they are not dynamic like a controlsource; they are easy to be made
> obsolete.
>
> And I usually can't recall whether recordsetclone is or is not affected by
> the filter when filteron  is true, I have to keep looking that up!
>
> I give them the well earned label of "tricky"; I also wish there were a
> filters collection for increments and decremental filters.
> On Dec 27, 2014 12:03 PM, "Gustav Brock" <gustav at cactus.dk> wrote:
>
> > Hi Bill
> >
> > No, filters are not very tricky. But the filter can only be changed if
> > something tells it so.
> > So either you will have to use the AfterUpdate event of the other form to
> > reapply the filter, or you can use the OnActivate event of the form to
> > check if the value to filter for has changed on the other form.
> >
> > /gustav
> >
> > ________________________________________
> > Fra: accessd-bounces at databaseadvisors.com <
> > accessd-bounces at databaseadvisors.com> på vegne af Mark Simms <
> > marksimms at verizon.net>
> > Sendt: 27. december 2014 17:22
> > Til: 'Access Developers discussion and problem solving'
> > Emne: Re: [AccessD] trying to filter a form on a control's value
> >
> > Yes, that toggle is required. Filters are very tricky.
> >
> > >
> > > Are you setting the Filter On property too?  I seem to recall needing
> to
> > > set filter on to False, setting the filter, and then setting filter on
> to True.
> > >
> > > Charlotte
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list