Populate a ListBox with Tables Names and Table Data

hewstone999

Registered User.
Local time
Today, 14:34
Joined
Feb 27, 2008
Messages
37
I have 2 questions/problems:

1. I want to populate a list box with all the Tables Names in my Database using VBA.

2. I also want to create another List Box or Grid (or any thing that will show table data) that when i have select a Table Name (See above (1)) it will show all the data in that table in the List Box. Was thinking some kind of SQL using vba to populate the list box?

Any ideas or help will be much appreciated

Richard
 
the easiest way to do 1 is to create a table of the objects in your database, and populate this by iterating those objects. Ive not checked, but there must be database documenter examples here

then you have a table which will easily serve as a source for your combo box

-------------
i think the list box is much harder

it might be easier just to click a button and run

docmd.opentable "mytable" to display the data, although this will show the data in a popup window. You need to be careful not to make the table editable, or make changes directly

It is unusual to inspect tables directly anyway - many will contain index references of linked tables, rather than meaningful data. These of themselves are not terribly informative. and the dbs adsministratoir can always open the tables directly if he needs to see what details are held
 

Users who are viewing this thread

Back
Top Bottom