Printing Report from a Filtered Form


Bill Dearborn

I have run into a number of problems with Filters that I
cannot seem to get around and would appreciate any help,
direction, hints etc ...:

a: Is there any way that a command button or other control.
can be applied to the "Filter by Form" form that would give
the command to apply the filter? Yes, there is the menu, the
tool bar, and the right click menu, but I have provided
buttons for all the other commands and would like to do the
same in this instance.

b. The database under development is to be distributed with
the Access 2002 Runtime package, but it appears that the
Runtime package does not allow the commands - Filter by
Form, Filter by Selection or Advanced Filter/Sort. Is there
anyway around this limitation or will we have to provide
full versions of Access to be able to Filter our records in
a Form?

c. The main form in my database is based on a Query, I apply
a filter to this form and then I want to print the filtered
data ... I check the forms ME.FilterOn property and if true
I transfer the Me.Filter string to a Where clause which I
include in the report open command (I have examined these
with the debug commands and the information is there.) The
result is that I always receive a request for a Parameter
Value for each of the selections made in the Filter By Form,
then when I get the value correct I either recieve a Blank
Report or a Report with all 4000 of the records showing. Why
is the filtered data not appearing in the report? What am I

Any help would be greatly appreciated.

Allen Browne

a) No: Command buttons cannot work when the form is in Filter By Form (FBF)

b) No: FBF etc won't work with the runtime. You will have to provide your
own filtering mechanism.

c) Modify the report's RecordSource so that it contains all the tables and
fields using the same names as used in your form. In Access 2002 and later,
if you filter a combo where the bound column is not the display column, when
you examine the Filter of your form you may see something like:
(lookup_Cities.City='New York')
To use the same filter in your report, you will need to include the Cities
table in the report's RecordSource query, and alias the table with the same
name as used in the filter string.

In the end, you will give up on FBF, and develop a filter system that an end
user can actually use. FWIW, this is how I approach it:
Search form - Handle many optional criteria

Finally, I suggest you don't post with a real email address in it (if you
did.) There be spambots active here.

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