Copy Linked Access Tables to Local Tables with VBA (1 Viewer)

Access or E

New member
Local time
Today, 11:22
Joined
Aug 29, 2022
Messages
12
I have an MS Access database with linked network tables that I need to copy to local tables into a new database along with the front end using VBA. How would I go about doing this? Would the TransferDatabase method be the best way? Thanks in advance for advice.
 

KitaYama

Well-known member
Local time
Tomorrow, 00:22
Joined
Jan 6, 2022
Messages
1,604
DoCmd.SelectObject acTable, YourTableName, True
DoCmd.RunCommand acCmdConvertLinkedTableToLocal
 

ebs17

Well-known member
Local time
Today, 17:22
Joined
Feb 7, 2020
Messages
2,004
into a new database
Use extApp.DoCmd.TransferDatabase ... (after creating this new database).
In addition to the structure and data, the indices are also transferred.
extApp must be the reference to the Application object of one of the two backends.
 

Access or E

New member
Local time
Today, 11:22
Joined
Aug 29, 2022
Messages
12
When I try the DoCmd.RunCommand acCmdConvertLinkedTableToLocal it throws a runtime error message 2046.

1674740582835.png
 

isladogs

MVP / VIP
Local time
Today, 16:22
Joined
Jan 14, 2017
Messages
18,272
You can also right click any linked table and select the option to convert to local table
 

tucker61

Registered User.
Local time
Today, 08:22
Joined
Jan 13, 2008
Messages
327
I know this thread is old, but I get the same error when running the code - but it works ok if i step through the code using F8.
 

Users who are viewing this thread

Top Bottom