Combo Box Problem.... i need a "light"....

I have 1 combo box whitch data source is a data base... but some item's of combo are duplicated... but i want only 1 item of eatch type like: (Monitor / Printer / Scanner / Printer), i would like remove second printer... i need do that on combo properties or on data base connection (combo <---> DB)

sorry my english...


Answer this question

Combo Box Problem.... i need a "light"....

  • Rajen Suchede

    The short answer is to use the DISTINCT keyword in the query which accesses your database table.  For example...

       SELECT DISTINCT PeripheralName FROM SystemTable

    Here's the long answer.  There should be a table that already has a distinct list of peripherals.  (You should create one, if it doesn't already exist.)  So, the real answer is to use this table as the source of your combo box.  Using your example above, you'd have a Peripheral table with three records, one each for "Monitor", "Printer", and "Scanner".  No need to do a DISTINCT and you have a better designed database.

    Hope this helps.

     - Mitchell S. Honnert

  • Combo Box Problem.... i need a "light"....