Selecting Records in Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm not sure if this can be done or not, but here goes....

I've set up a query to determine how long it take to run individual loads
that arrive at our facility. Now what I would like to do it set up the
report (I've already formatted the report) so that a dialog box or something
like it comes up and gives the operator a list of all vendors with a check
box. They would then have the ability to select only the vendors that need
to be reported on. I would use selection criteria in the query, but there
are over 150 vendors, with different ones being selected each week for time
studies. Currently, there are 27 vendors that require time studies this
week. Next week it could be 1 or it could be 40. Each week it changes.

Is this possible using Access 97?

Thanks
 
Ok, I've created the form and copied the code. I'm getting the list box with
the vendors, however there are 2 problems....

1. I have a date range parameter in the query and it's asking me for the
date range before I get to the form, and again after I've made the selections

2. Despite having selected only 2 of the vendors, the report is still not
filtering for just the selected vendors.

I'm not real good with code, so I'm sure the problem is in there somewhere.

Thanks
 
Perhaps you can omit the dates until you get the vendors working. Better to
solve it one step at a time.

Presumably you changed [CategoryID] in the code to [VendorID] or whatever
your field is called. Is your VendorID a Number or a Text type field (when
you open the table in design view)?

Before the OpenReport line in the code, enter:
Debug.Print strWhere
Then after you click the command button to open the report, press Ctrl+G to
open the Immediate Window. What does it show for the value of the filter
string?

After you get that working, you can use text boxes on the form for the dates
as well. See:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html
The two parts of the string will need to be joined with an " AND " in the
middle.
 
Back
Top