Select table name from tabs - equivalent

Is there an equivalent statement in access to the Oracle select table_name from tabs; statement. I need to do this to populate a combo box with user table names. I presume you can do it accessing the Mysysobjects or some other hidden table. Any ideas anyone??
neilhomanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

paaskyCommented:
Hello neilhoman,

The tablenames are stored in TableDefs collection.

You can browse names with something like this:

Function test()
Dim i As Integer
   
    With CurrentDb
        For i = 0 To .TableDefs.Count - 1
            Debug.Print .TableDefs(i).Name
        Next
    End With
       
End Function

Regards,
Paasky
0
paaskyCommented:
These are system tables:

MSysACEs
MSysModules
MSysModules2
MSysObjects
MSysQueries
MSysRelationships

This is how to query table names:

SELECT MSysObjects.Name, MSysObjects.Type, *
FROM MSysObjects
WHERE (((MSysObjects.Type)=1));

Paasky
0
paaskyCommented:
If you don't want see system tables in your query try this:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Type=1
AND MSysObjects.Name NOT IN
("MSysACEs","MSysModules","MSysModules2","MSysObjects","MSysQueries","MSysRelationships");



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

brewdogCommented:
either way you're going to have to loop. I typically use paasky's first suggestion, like so:

Dim tdf as tabledef
dim strList as string

for each tdf in currentdb.tabledefs
   if not tdf.name like "MSys*" then strList = strList & tdf.name & ";"
next tdf

For this to work, though, you have to set your combo box's RowSourceType to Value List.

Hope that helps . . .

brewdog
0
neilhomanAuthor Commented:
Thanx guys just checking both approaches now....will give points later.
0
neilhomanAuthor Commented:
Thanx paasky and apologies to bredog except paasky's wuery was exactly what I needed -

Keep Up the good work
-Neil
0
brewdogCommented:
no apology necessary. Glad it's all solved.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.