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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Novice: How to select several records within report (query)

Status
Not open for further replies.

Jillp

Technical User
Jun 7, 2001
75
US
Hello,

I am a novice access report writer. We have a report that allows us to select an EMPID and between date ranges. What we would like to do is select several EMPID within this date range. I need the report to ask the user to enter these EMPID's.

I tried adding 'in' to the field selection in the query -- but it looks like I would need to add all the EMPID's in the query rather than allow the user to enter them when she is running the report.

I'd appreciate any help you can offer me.

TIA,

Jill
 
Try This

Code:
SELECT Test.Test
FROM Test
WHERE (((Test.Test)=[Name1])) OR (((Test.Test)=[Name2])) OR (((Test.Test)=[Name3]));

You can just put the prompts in the criteria section of the query. Use [WhatYouWantBoxToSay] for each one. Don't put them all in the same box just keep moving to the next one down.

Hope that helps

Dan

Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body. But, rather to skid in sideways, chocolate in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO what a ride!
 
Or you could run the reports from a form. On the form place a control for each parameter needed for the reports, for example, starting date, ending date, and employees. The employees (IDs) could be chosen from a list box that allows multiple entries. Then the user could click a button to preview or print the report.

The report's query can directly refer to the values of the date range controls on the form. It might also work referring to the list box control (as: IN me.lstEmpIDs ) or you might have to build the IN value list string in your code and use it as a parameter for the docmd.openreport fuction.

This would also enable you to have enpIDs selected from a valid list of employees.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top