This is what I need to do, before opening a report be able to limit the report to specific criteria - in this case a SS#. I know I can go to the query that controls the report and put the SS# there but can I have a window come up asking for the SS# when I click to open the report?
Pat Hartman
05-08-2001, 08:22 PM
Add a parameter to the query that is used as the report's recordsource. If the report is based directly on a table, make a query selecting all the columns needed by the report, create the parameter (as described next), then save the query. Change the report's recordsource to use the new query.
On the criteria line for the SSN column put -
[Enter SSN]
When you open the report, the query runs and promps you to enter a SSN.
Thank you so much, that worked perfectly. If I want to print the report for a few different ssn's can I be able to enter more than one SSN sometimes or do I need to print one, close, open again and enter the next SSN?
Pat Hartman
05-09-2001, 07:43 PM
The method to print multiple selected SSN's is more complex. One method is to create a form with a multi-select list box. You then need to write code to loop through the selected items and print a report for each selection. Or you could loop through the selected items and create the IN(...) part of an SQL statement which you then use as the recordsource for your report.
Maybe someone will paste code they have created to do this.