Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996



Application Security Testing: An Integral Part of DevOps

Retrieving Table List

How can I get the tables within an Access2.0 database to show in a list box? The user will specify a database in a text box and I want them to be able to choose which table they want to work with. Also, once I get the table, how can I have the fields of that table show up in another list box? I have tried using the List Fields Method to no avail.

You can loop through the TableDefs collection, which is a property of the Database object. Those are all the tables in the currently active database. You can add them into the list box with the AddItem method. Here's an example:

Dim db as Database
Dim td as TableDef
Set db = OpenDatabase("Filename")
For Each td In db.TableDefs
   ListBox.AddItem td.Name
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date