Using code I found here: https://accessexperts.com/blog/2011/07/07/sharepoint-lists-and-microsoftaccess/
I have used the following code to Link a SharePoint View in Access:
DoCmd.TransferSharePointList acLinkSharePointList, "http:\serversite", _
"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", _ 'Sharepoint List GUID
"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", _ 'SharePoint View GUID
"tblMyList", True
This code has worked for me the past when I was using AC2010 (unsure which version of SP I was using). I am currently using Access Microsoft 365 MSO (Version 2202 Build 16.0.14931.20128) 64-bit and SharePoint Online and the code above does not work.
By does not work, I mean the code executes with no errors but it does not link the view.
Any ideas?
CodePudding user response:
And I stumbled across the answer. In one of the comments, the author answered a question:
Blockquote The hard part is that URLs for lists can vary depending on whether you are using a company’s SharePoint server or a hosted SharePoint, how it is placed in the overall structure and other factors. Also, consider that you have sufficient permissions to actually view the required page. If you are not an administrator, you may need to ask whoever administrate the site to tell you the GUID for the list.
Assuming you have sufficient permissions, here’s a way to find out:
- Open your web browser
- Use the following URL:
//_layouts/viewlsts.aspx
replacing the with your SharePoint’s domain and with the complete path to the site that contains the list you need. As an example, suppose you have a Office 365 site, it may look something like this:
https://mycompanyname.sharepoint.com/sites/mysite/_layouts/viewlsts.aspx
Blockquote
Once I amended my path name with the /_layouts/viewlists.aspx, everything linked up perfectly.