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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling ComboBox

Status
Not open for further replies.

msay

Programmer
Aug 17, 2001
56
US
Hello, I'm filling a ComboBox with dates from an access database. My problem is I only want a date to appear in the combobox one time. Example: If there are ten "4/25/03" and five "4/20/03" dates in a table, I only want them to show up in the ComboBox one time. Here's an example of the code that doesn't work:

'load database parameters here

rst3.MoveFirst
While Not rst3.EOF
Combo2.AddItem rst3!batchDate
rst3.MoveNext
Wend
This code load all 15 dates.
Any help would be welcomed! Thanks
Mike Sayler
 

Dont change the code where u populate the combo, but change the db query from which you get the dates. Use Distinct clause in the SQL Statement to get unique dates from the database.

eg: Select distinct myDate from myTable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top