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

Records that match ALL items in a listbox

Status
Not open for further replies.

danvlas

Programmer
Jul 30, 2002
2,446
RO
Hello all,

Setup:

Employees (one)->(many)EmployeeCourses(many)<-(one)Courses

I've made a multiselect listbox (based on table Courses) on a form displaying all courses.

I need to create a query to list employees that have taken ALL selected courses.

No matter what I do, I can only list employees that have taken or have not taken any of the selected courses, but not all. And I just can't figure out the logic...

Can anyone give me a hand here?

Thanks in advance



[pipe]
Daniel Vlas
Systems Consultant

 
I made it, nevermind.

EmpID In (Select Employee From tCourseSchedule Where Course In(1,2,3) Group By Employee Having Count(EmpCrsID)=3)

(1,2,3) is built dynamically from the listbox and the final 3 is taken from ListBoxName.ItemsSelected.Count

I thought someone might find this useful...



[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top