How to remove duplicates in a cbo

S

steven

We tender projects and use a database to record all
project details including subcontractor details.
Currently, the subcontractor table is linked to the
project table. We use a cbo to search the contractor table
and display all details about the contractor and the
project they are working on. The problem is when a
subcontractor may have won several projects. In the Cbo,
the subcontractor appears multiple times depending on the
number of projects which they have won; as each time the
name appears, it is linked to a specific project.
Grateful advice how to remove this duplication, so that a
subcontractor appears only once in the cbo and when a
subcontractor is selected, all projects connected to that
subcontractor are filtered and displayed - hope this makes
sense and thanks.
 
R

Rolls

If you're using the QBE window to produce the query, click on the Sigma
icon, which will add a row that says Total: "Group By'. That's it!

SQL View w/o "group by" returns duplicates:

SELECT tblProducts.ProductName
FROM tblProducts;

SQL View with "group by" returns unique values:

SELECT tblProducts.ProductName
FROM tblProducts
GROUP BY tblProducts.ProductName;
 
J

John W. Vinson

We tender projects and use a database to record all
project details including subcontractor details.
Currently, the subcontractor table is linked to the
project table. We use a cbo to search the contractor table
and display all details about the contractor and the
project they are working on. The problem is when a
subcontractor may have won several projects. In the Cbo,
the subcontractor appears multiple times depending on the
number of projects which they have won; as each time the
name appears, it is linked to a specific project.
Grateful advice how to remove this duplication, so that a
subcontractor appears only once in the cbo and when a
subcontractor is selected, all projects connected to that
subcontractor are filtered and displayed - hope this makes
sense and thanks.

I think you need to reconsider how you're setting up the form and the
combo. If you're using the combo to pick contractors, the Combo should
be based *ONLY* on the Contractor table, rather than on a query
linking it to the projects table. It is not necessary for the combo to
contain projects information if the projects information is intended
to appear on the form.

What are the RowSource of the combo, and the Recordsource of the form?
 

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

Top