Solved

DISTINCT not working in combobox

Posted on 2009-05-13
2
335 Views
Last Modified: 2012-06-22
I use the below query as the row source for a combobox in a form. If I just run the query no duplicates are shown, however in the combobox the duplicates are shown.

Why is this happening?
SELECT DISTINCT BankAccountNumber FROM itblBankAccounts WHERE BusinessUnit IN (SELECT BusinessUnit FROM qryBusinessUnits) ORDER BY BankAccountNumber;

Open in new window

form.bmp
query.bmp
0
Comment
Question by:bejhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 150 total points
ID: 24378260
are you loading the data 2 times, presumably...
0
 
LVL 1

Author Comment

by:bejhan
ID: 24378336
Oh jesus I feel like an idiot. I forgot I set the recordsource when the form loads... not really sure why I'm doing that but thats why. I forgot to change to DISTINCT in there.

Easy points eh?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question