How can I remove duplicates from my Combo Box

  • Thread starter benton via AccessMonster.com
  • Start date
B

benton via AccessMonster.com

Broker No Broker Name Month Premiuns
1028811162 ABDOL,VE,MR 01/08/2005 3000
1028811162 ABDOL,VE,MR 01/09/2005 -16692
1028811162 ABDOL,VE,MR 01/10/2004 -48
1068787405 ABDUL,P,MS 01/08/2005 56100
1068787405 ABDUL,P,MS 01/09/2005 41376
1068787405 ABDUL,P,MS 01/10/2005 -19092

I have a table that tracks broker production on a monthly basis. Each and
every month a database has to be updated with new premiums.

This could be a wrong table layout .I have a combo box on my form that looks
up the broker number and diplay the information about that broker. When I
click on the drop down arrow. It lists the same Broker number for a every
month ( e.g it lists 1028811162 three times).How can I remove the duplicates
broker numbers on my Combo Box. Here’s an example of my table. My combo box
is based on the above table.
 
G

Guest

Hi Benton,

Your broker names should be placed into a separate table, which is linked
1:M (one-to-many) to your existing table indicated below. Each broker name in
tblBrokers would only be entered one time. The first and last names should be
entered into separate fields. A SQL statement or saved query, sorted
ascending by BrokerLastName, BrokerFirstName would serve as the RowSource for
your combo box.

In order to get your current setup to work, you'll need to use the
DISTINCTROW keyword. However, this is certainly not as efficient as starting
with a properly normalized database design. Something like this shold work as
a row source:

SELECT DISTINCTROW [Broker Name]
FROM TableName
ORDER BY [Broker Name]

with column count = 1 and bound column = 1.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Broker No Broker Name Month Premiuns
1028811162 ABDOL,VE,MR 01/08/2005 3000
1028811162 ABDOL,VE,MR 01/09/2005 -16692
1028811162 ABDOL,VE,MR 01/10/2004 -48
1068787405 ABDUL,P,MS 01/08/2005 56100
1068787405 ABDUL,P,MS 01/09/2005 41376
1068787405 ABDUL,P,MS 01/10/2005 -19092

I have a table that tracks broker production on a monthly basis. Each and
every month a database has to be updated with new premiums.

This could be a wrong table layout .I have a combo box on my form that looks
up the broker number and diplay the information about that broker. When I
click on the drop down arrow. It lists the same Broker number for a every
month ( e.g it lists 1028811162 three times).How can I remove the duplicates
broker numbers on my Combo Box. Here’s an example of my table. My combo box
is based on the above table.
 

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