Just replace the msgbox with a string or array or whatever
you want to store values in.
Dim db As Database
Dim varTable As Variant
Set db = CurrentDb
For Each varTable In db.TableDefs
If Len(varTable.Connect) > 1 Then
msgbox "Linked table: " & varTable.Name
Else
msgbox "Local table: " & varTable.Name
End If
Next
db.Close
Set db = Nothing
Something like the following untested aircode should do it:
Dim db As Database
Dim tdf As TableDef
Set dbCurr = OpenDatabase("C:\My Documents\MyDatabase.mdb")
For Each tdf In dbCurr.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
Debug.Print tdf.Name
End If
Next tdf
Set tdf = Nothing
Set dbCurr = Nothing
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.