471,092 Members | 1,011 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Form-filtering problem

I have a problem using the form .Filter and .FilterOn properties which
causes Access to crash (as detailed in a separate post). The form operates
in continuous mode, displaying matching records from a file based on a
search criterion. This basic functionality works just fine.

I decided to allow the user to narrow down the output by providing some
extra controls to allow the user to filter the recordset via the .Filter
form property. Any data entered into these extra controls is used to
generate a clasue suitable for the .Filter property. This also works fine
when the application of the filter reduces the number of records displayed.
The problem occurs when I subsequently update the filter data such that it
increases the number of records displayed, or even turn off the filter to
return the display to the full recordset -- Access crashes with the
familiar "Access has encountered a problem and needs to close...".
However, stepping through the code, it works just fine, so I know that the
filter clauses used are OK.

Some things I have already tried (to no avail):
* Setting the form's .Filter property directly with the filter clause;
* Using the DoCmd.ApplyFilter and DoCmd.ShowAllRecords commands
* Setting .FilterOn before and after setting the filter clause

I suspect that setting the .Filter property causes some events to trigger
asynchronously, and that this somehow conflicts with the execution of my
code. Perhaps you can only filter in such a way that it will reduce the
number of records displayed, and that you can't then change the filter such
that it will increase the number of displayed records (or turn off the
filter altogether)? To change the filtering such that it will increase the
number of displayed records (after the number of records has already been
decreased by filtering), perhaps it is necessary first to requery the
original recordset so that you start again with a full deck (so to speak)?

In other words, do I have a real problem -- or is there a restriction that
you can only filter down to a smaller set of records (and can't
subsequently "unfilter")?

I hope this makes some sense.

Oct 21 '07 #1
0 1849

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by John | last post: by
5 posts views Thread by Richard Cornford | last post: by
4 posts views Thread by Targa | last post: by
6 posts views Thread by Gary Miller | last post: by
19 posts views Thread by Coward 9 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.