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