Field values used to filter a report

J

Jorist

I have a report that is based upon a query that filters the data in a variety
of ways. The net result is a listing of Zip Codes that I ultimately use as a
part of the data for a report. The contents of this report is limited to the
Zip Codes from the query. (Not a true filter) I need to be able to print this
list of zip codes in a comma seperated list in the report header. I am sure
this can be easily accomplished but for the life of me I cannot figure this
out. Any help would be greatly appreciated.

Thanks in advance.
 
A

Allen Browne

There are 2 parts to your question:
a) How to provide an interface so the user can choose multiple zip codes.
b) How to pass the filter list to the report.

You will need to provide an interface where the user can choose the zip
codes. A form with a multi-select list box would be an obvious choice. You
will then loop through the ItemsSelected in the list box to build up the
WhereCondition string for the report. You can also pass this list to the
report in its OpenArgs, and use that to display the list on the report.

See:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html

Step 9 of the instructions explains how to pass that to the report as well.
 
J

Jorist

Allen:
Thanks for the response but this does not work for me. The user is not
allowed to choose the zip codes. The zip codes to use are determined by some
mathmatical formulas and the user does not see them. This is why they need to
be listed in the header of the report.

The zip codes resides in one of the fields that is used in the data
source for the report. I need to print the zip codes into a label or text box
with a comma seperating each zip code for all zip codes in the table.

Any thoughts?

Jorist
 
A

Allen Browne

I don't understand how the zip code are selected to filter to the report.

The point is that - whatever the selection process - those values must be
passed to the report in order to be displayed there. One way to pass them to
the report is to use OpenArgs in your OpenReport (assuming Access 2002 or
later.)

In earlier versions, you could use a public string variable to pass them.
 

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

Top