By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Row Source dropdown unique records

P: 48
I've been looking around, and haven't been able to find this one...

I'm going to revert back to the usual store example. So, I have customers who have bought items through different employees, and employees clearly help multiple customers. Now, on this form I have a text box for customerID. AfterUpdate, I want my EmployeeID combo box to display unique employees who have served that specificed customer. Currently I have this:

Me.[EmployeeID].RowSource = "SELECT Payroll.EmployeeID FROM Payroll WHERE (Payroll.CustomerID='" & Me.CustomerID & "') ORDER BY [EmployeeID];"

Now this does indeed select the employees that have ever served the customer. HOWEVER (and here's the problem), it repeats employees every single time it finds a hit. In other words, for Customer "A", who has bought 20 items all from Employee "Z", the row source lists "Z" 20 times. I need it to be once (for each unique hit). Suggestions?

As always, thank you in advance.
Aug 15 '07 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,392
Use SELECT DISTINCT.
Aug 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.