Want only UNIQUE INFO for Combo Box

  • Thread starter Thread starter kealaz
  • Start date Start date
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!!!!
 
Change your row source by using a grouping clause to

Row Source: SELECT tblBUY.VENDORNAME FROM tblBUY GROUP BY tblBuy.VENDORNAME;
 
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.
 
Back
Top