obtain a list of all tables in a database

thydzik

Registered User.
Local time
Today, 15:40
Joined
Jun 17, 2006
Messages
27
I am trying to obtain a list of all tables in my database that will be used to populate a combobox.

The way I would assume to do this (in excel) is:


Dim r as recordset
For each r in recordsets
combobox1.additem r.name
Next r


but obviously it isn't the same in access, so could someone please help me out.
 
Hello:
To list all the tables in a database you would use the AllTables collection:
'
Sub AllTables()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
' Search for open AccessObject objects in AllTables collection.
For Each obj In dbs.AllTables
' Print name of obj.
MsgBox obj.Name
Next obj
End Sub
'
Regards
Mark
 
Thanks mate!

just what i wanted
 

Users who are viewing this thread

Back
Top Bottom