Duplicates in Combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a problem with a combo box. I have it pulling values from a
table, but my problem is that it pulls from a table for the customer names.
It works but there are multiple entries with the same names. How do I stop
the combo box from showing duplicate entries?
 
I'm having a problem with a combo box. I have it pulling values from a
table, but my problem is that it pulls from a table for the customer names.
It works but there are multiple entries with the same names. How do I stop
the combo box from showing duplicate entries?

Change the Rowsource/Query of the combo box from
Select YourTable.[FieldName .... etc.
to:
Select Distinct YourTable.[FieldName] .....

What do you expect to do if you have different customers with the same
name?
 
You can stop the duplicates, but depending on what you're using it for, that
may or may not help.

If you have a list of first names, there will probably be several repeats.
If you want to select a first name by picking it from the list and the
selection has no meaning to any particular record (i.e. it just supplies the
name) that will work. Typically, this type of combo box will have only the
one column. However, if you're trying to pick a certain record by the list
of names, you'll need enough columns in the combo box to be able to
distinguish which record is which so that you know which one to pick. In
this case, the duplicates aren't really duplicates because you're selecting
on more than one criteria.

If you are doing the first example, then to get rid of the duplicates, you
need to adjust the query that is used as the Row Source of the combo box. If
you're just using the table as the Row Source, you'll need to make a query
and use that instead. Once you have the query, open it in design view, right
click the background in the area where the tables go, and choose Properties.
Set the Unique Values property to Yes and save the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top