Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to select distinct values from ADODB data table for Combo Box 1

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
This may be ridiculous, but it seems to me there ought to be a way to do it...

I have an ADODB data table with hundreds of entries, it's not part of a dataset. I want to show a list of values from one column (city) in a conbo box so a user can select a city, and then I'll drop the records for that city into a DataViewGrid. But I can't seen to figure out how to bind the combo box to the data table without getting a line for every record in the table. There must be a way to do this, right?



CraigHartz
 



hi,

Use a query as the data source, not the table...
Code:
Select DISTINCT [City] From [Your Table]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thank you Skip,

It took me a couple of hours on my own but I finally did figure that out. Of course, you are correct.

Craig

CraigHartz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top