Show tablenames

  • Thread starter Thread starter Guest
  • Start date Start date
Is there away to show all tables in a combobox in a form

I don't like messing about with undocumented System tables <g> -- the
recommended method to use the catalog is using DAO:

dim rowSource as string
dim tdf as TableDef

for each tdf in TableDefs
' check Help for the relevant flags
If tdf.attibutes AND c_IsAUserTableAttribute >0 Then
if len(rowSource)>0 Then rowSource = rowSource & ";"
rowSource = rowSource & tdf.Name
End If

next tdf

tablesComboBox.RowSource = rowSource


Hope that helps


Tim F
 
You can base the combo box on this query (which will, normally, show all
non-system tables in your database):

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "msys" & "*") AND
((MSysObjects.Type)=1));


Bob Galway
www.bbg-enterprises.com
 
Thanks bob
its working
Alvin


bob said:
You can base the combo box on this query (which will, normally, show all
non-system tables in your database):

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "msys" & "*") AND
((MSysObjects.Type)=1));


Bob Galway
www.bbg-enterprises.com
 
While I understand where you're coming from, Tim, you might want to read
MichKa's comments on this subject at
http://www.trigeminal.com/usenet/usenet017.asp

Thanks for this link, Douglas; I remember reading (something very like)
this in the past but didn't keep the reference. Hence the <g> because I
knew there are valid reasons why reading the systems table is "probably"
okay.

All the best


Tim F
 
Back
Top