Question : VBA to export linked tables in current Access to Db to another Access Db

The block of code below exports specific tables in my current Access database to another Access database.  

However, when I export "Linked" tables from my source table, it still shows as a linked table in target Access database.  Is there anyway to modified this code to ensure the tables won't appear a links, but instead appear as imported tables?

Thanks for any help.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Public Function ExportTables()

    Dim db As Database
    Dim rs As Recordset
    Dim sSQL As String
    
    sSQL = "select SourceTableName, TargetTableName, DatabaseName from tblTableExport"
    
    Set db = CurrentDb()
    Set rs = db.OpenRecordset(sSQL)
    
    Do While Not rs.EOF
    
        DoCmd.TransferDatabase transfertype:=acExport, _
          databasetype:="Microsoft Access", _
          databasename:=rs.Fields(2).Value, _
          ObjectType:=acTable, Source:=rs.Fields(0).Value, _
          Destination:=rs.Fields(1).Value, structureonly:=False

        rs.MoveNext
        
    Loop

End Function

Answer : VBA to export linked tables in current Access to Db to another Access Db

you need to export the table from the original db to make show as non linked table in the destination.
Random Solutions  
 
programming4us programming4us