Want only UNIQUE INFO for Combo Box

K

kealaz

On my form [frmPO_ISSUE] I have a combo box [VENDORNAME] which is populated
with only Vendors that are in my table [tblBUY].


If my table has the following....
part001 vendor001
part002 vendor001
part003 vendor001
part004 vendor002
part005 vendor002
part006 vendor003

where I am going to buy multiple parts from vendor 1 & 2

currently, my combo box looks like this.
vendor001
vendor001
vendor001
vendor002
vendor002
vendor003


How can I have it look for "unique" vendors, such that there are only three
selections.
Vendor001
vendor002
vendor003

Right now, the Row Source info for this combo box is

Row Source Type: Table/Query
Row Source: SELECT tblBUY.VENDORNAME FROM tblBUY;

Can I change the above to accomplish what I described?

Thank you very much for your help with this!!!!
 
C

Chegu Tom

Change your row source by using a grouping clause to

Row Source: SELECT tblBUY.VENDORNAME FROM tblBUY GROUP BY tblBuy.VENDORNAME;
 
A

Arvin Meyer MVP

You want to use the DISTINCT predicate when setting the rowsource of the
combo:

SELECT DISTINCT VendorID FROM tblParts:

Ideally, you should have a table for Vendors so that you can select from
them.
 

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