Copying a linked table

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
 
K

KC-Mass

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
 
J

John

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
 
K

KC-Mass

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
 

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.

Ask a Question

Top