Convert sharepoint linked table to local table (1 Viewer)

AliyuKatsina

Registered User.
Local time
Today, 13:36
Joined
Dec 31, 2009
Messages
73
Hi,

I wish to convert an imported sharepoint list to local table via vba.

the import is successful, however converting the list to a local table is my headache.


This is the code I used:

DoCmd.TransferDatabase acImport, "Microsoft Access", FPath, acTable, "SchoolList", "AccessTbl", 0

DoCmd.SelectObject acTable, "AccessTbl", True

RunCommand acCmdConvertLinkedTableToLocal

I got Error message no 2046 that the command ConvertLinkedTableToLocal is not available now! Please what is available now to accomplish the same task? :banghead::banghead::banghead:
 

isladogs

MVP / VIP
Local time
Today, 12:36
Joined
Jan 14, 2017
Messages
18,209
I've never worked with Sharepoint.

However, the first line of your code imports tables as local anyway
So the other two lines are I believe redundant and are I think the cause of your error
This should be all you need:
Code:
DoCmd.TransferDatabase acImport, "Microsoft Access", FPath, acTable, "SchoolList", "AccessTbl", 0

To link to an external table, use acLink rather than acImport
Then the other two lines will convert it to local without error.
Code:
DoCmd.TransferDatabase [B][COLOR="DarkRed"]acLink[/COLOR][/B], "Microsoft Access", FPath, acTable, "SchoolList", "AccessTbl", 0

DoCmd.SelectObject acTable, "AccessTbl", True

[B][COLOR="DarkRed"]DoCmd.[/COLOR][/B]RunCommand acCmdConvertLinkedTableToLocal

The simplest way of converting linked to local involves no VBA.
Right click on the table in the nav pane and click 'Convert to Local Table'.
Just make sure the table isn't in use when you do so
 
Last edited:

Users who are viewing this thread

Top Bottom