Filter by Form

  • Thread starter Thread starter Alasdair
  • Start date Start date
A

Alasdair

I have a number of forms that I want to use for edit and
input.

Given the number of records underlying these forms, I
would like to invoke the Filter by Form functionality to
allow users to narrow the recordset when editing records.
I have added a command button that invokes this "filter
mode", but the items that are chosen are not saved in the
form's Filter property when the Filter by Form is closed.

I can't see how to ensure that the Filter property is
updated on the closure of the Filter by Form view - it
doesn't seem to have any event handlers !

Any help / guidance appreciated !

Alasdair
 
Filter By Form should cause the filter to be applied on exit.

If you want to reapply the same filter while the form is still open, you
should be able to depress the toolbar button.

If you want to keep the filter string and reapply it automatically next time
the form is opened, write the value to a memo fields in a table, and read
and it in Form_Open. The mechanism to store and read the value from the
table is explained in this article:
http://allenbrowne.com/ser-18.html
but make sure you use a Memo field since the Filter can be quite long.
 
Allen,

Many thanks for responding so quickly. The behaviour you
describe doesn't seem to happen !

When the Filter by Form is closed, the main form remains
unfiltered and the Filter property stays blank ! When I
try this manually (using toolbar buttons) the same is
true - the filter is only saved and applied when the
ApplyFilter toolbar button is pressed to close the
FilterbyForm.

However, programatically, I don't want the toolbars to be
available, and any button I place on the face of the main
form is inactive in the FilterbyForm !

Just closing the FilterbyForm (using the close button in
the top right hand corner) seems to abort the filter.

Alasdair
 
Ah: now I see where you are coming from.

Yes, Filter by form is a special mode where any command buttons on the form
are not available, and the Filter property of the form has not been set.
Closing the form does abort the filter. The only choices are to apply the
filter or abort.

Your could create a custom toolbar to perform the apply filter. Ctrl+drag
the built-in button onto your toolbar (so as to copy, not move it).

If that solution is not acceptable, then you have out-grown Filter By Form.
Given that it doesn't work in an MDE or runtime, Filter By Form is next to
useless for an end-user application anyway.
 
Back
Top