Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Multiple Records for Printing

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a table of employees that includes a field for their supervisor.

I want to open a form based on an individual supervisor--- list all of that supervisors employees. (No problem, I have done this from a query with just the supervisor and employee name fields)

Now I want to be able to select one or more of the employees on that form (check box maybe - but does not exist in employees table). Once I select the employe/s on the form I want to run a report showing only the employee/s selected. I have tried an unbound check box but it checks all if I click one box or none if I deselect a box.

How can I set up a control on the form (not bound to a table), that shows for each individual employee, where I can choose the employee/s to be printed...and can I pass that control to the report query?

I really don't want to add a field to the table and then have to manage it before and after the printing.

Thanks,
 
You may consider a MultiSelect ListBox and its SelectedItems collection to build in VBA the WhereCondition parameter of the DoCmd.OpenReport method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV

Good suggestion. My form now has a field for Supervisor and a Multi select list box for Employees. And, the multi select works fine. Now, how do I harvest the data?

I tried a query based on the Employee table where the Criteria for supervisor equals the supervisor field on the form. This works...then I added the tabel employee field to the query and set its criteria to the list box on the form....No go. It returns nothing.

Will I have to do this in VBA? If yes...please explain with a little code demo. If I can do it in a query...how?

I think we are close but I need to learn how to work with the multi select list output.

Thanks,
 
PHV and Remou,

Actually I did get the code I needed from an Access Book that talked about Multiple Selection List. But thanks for the help, you pointed me in the right direction.

As usual, more than one mind can do wonders.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top