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

Populating list boxes from a table

Status
Not open for further replies.

DC71

Programmer
Feb 27, 2001
1
CA
Hi,
I am writing a small application (with VB6) to update tables in an Access (2000) database. In this application I have some drop down list boxes that I want to populate from some lookup tables in the same database. I have created the data link (ADO) and I have created the connection in the data view.
When I look at the properties of the list boxes I can add the DataSource, DataMember, and the DataField but it only seems to add the first record from the table and does not fill the list box.

I feel that I am close but I don't know what else to try.
Any help will be greatly appreciated

Thanks in advance

DC
 
You should have this code:

While Not adc.EOF
cmb.AddItem adc!ColumnName
adc.MoveNext
WEnd

adc.Close

Set adc=Nothing

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top