You can check whether its Connect property is set.
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Set dbCurr = CurrentDb()
For Each tdfCurr In dbCurr.TableDefs
If Len(tdfCurr.Connect) > 0 Then
Debug.Print "Table " & tdfCurr.Name & " is linked."
Else
Debug.Print "Table " & tdfCurr.Name & " is not linked."
End If
Next tdfCurr
Another way would be to look it up in the MSysObjects table:
Function IsLinked(TableName As String) As Boolean
IsLinked = Nz(DLookup("Type", "MSysObjects", _
"Name = '" & TableName & "'"), 0) <> 1
End Function
(Non-linked tables have a type of 1, tables linked using ODBC have a type of
4 and all other linked tables have a type of 6)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Luis" <(E-Mail Removed)> wrote in message
news:00DDA716-4211-4195-8A33-(E-Mail Removed)...
> Hello.
> I'm trying to export all tables of a database to a new database. This task
> needs to run everyday.
> The issue here is that i don't want to export linked tables.
>
> How can i check if a table is linked or not?
>
> Thanks,
>
> Luis