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!

Newbie: How to set up a combo box to work on an Access table? 1

Status
Not open for further replies.

RikHess

MIS
Jul 25, 2002
69
US
I moving some Access apps to VB and ran into a problem with a lookup combo box. The table I'm using will contain a list of active tables in the database. No problem building the table at Form Load, but the Combobox will not read the file contents.

I have tried : cboTableNames.Refresh
after re-building the contents.

I have linked the Combobox using the DataSource, DataMember, and DataField properties, to no avail.

Any ideas are appreciated.

TIA,
Rik
 
I don't know if you can do this with the 'Data' properties.

This is the way I do things:

* open a connection to the DB
* run a query returning the values you want to add to the combobox in a recordset
*
Code:
 Do Until <recordset>.EOF
   <combobox>.additem <recordset>!<field>
   <recordset>.MoveNext
  Loop
* close the recordset and the db-connection

I'd be happy to help you further along with some sort of function if you can be a bit more specific on what you are looking for...
 
That was easier than I was trying to make it!

Thanks!
Rik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top