Copying a linked table

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is there a way to copy a linked table via code from front end such that copy
ends up in the back end too?

Thanks

Regards
 
Hi John

Yes. Set up query using the linked table as its source. Make it a
MakeTable query with the destination for the newtable in another MDB file.

Something like:

SELECT DateOfIt INTO tblNewTableInBE IN 'C:\Project\db4.mdb'
FROM tblDates;

Regards
Kevin
 
Hi

Thanks. Any way to pick up the back end db from the linked table? just to
make code generalised in case backend db is moved to another location.

Thanks

Regards
 
Hi John,

This would pick up the full path of a linked Access file in the backend or
elsewhere.

Sub Test()
Debug.Print PathForLnkdTable("tblProduction")
End Sub

Function PathForLnkdTable(strTableName As String) As String
PathForLnkdTable = Mid(CurrentDb.TableDefs(strTableName).Connect, 11)
End Function

Regards

Kevin
 
Back
Top