Results 1 to 2 of 2

Thread: Remove Duplicates from Combo Box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308

    Question Remove Duplicates from Combo Box

    Given a form [frm1] which contains a data combo box [dcb].
    On form load the combo box is populated with a recordset (Records) containing all rows from my SQL Table. The combo box displays Column(1) only, however this field contains duplicates which I do not wish to display.

    Code used:
    Set dcb.RowSource = Records
    dcb.ListField = Records(0).Name

    How could I modify my code to ensure that no duplicate names appear in my combo box?

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    You'll need to use a SELECT DISTINCT query for the adCommandText.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width