How to create a Global variable that is a file path to a Sharepoint Folder

Gregg Taylor (WH) 0 Reputation points
2025-01-11T09:57:34.68+00:00

I have an Access database in a SharePoint folder. I need for any users that can open the database to be able to read and write to other folders in Sharepoint.

I need to be able to use Export Specifications to write to the Sharepoint Folder

I need to be able to read in files from Sharepoint folder

I have tried to assign the hyperlink value to a Global variable

I have tried using FollowHyperlink to assign a value to a Global variable

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,221 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-01-11T09:57:34.7+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To create a global variable that holds a file path to a SharePoint folder in Microsoft Access, you can follow these steps:

    1. Define the Global Variable: At the top of your module, declare a global variable. For example:
         Global SharePointPath As String
      
    2. Assign the SharePoint Folder Path: You can set this variable to the path of your SharePoint folder. You can do this in a procedure or function:
         Sub SetSharePointPath()
             SharePointPath = "https://yoursharepointsite.com/path/to/folder"
         End Sub
      
    3. Using the Global Variable: Now, you can use SharePointPath in your export specifications or when reading files from the SharePoint folder.
    4. Export Specifications: When you want to write to the SharePoint folder, you can reference SharePointPath in your export specifications.
    5. Reading Files: Similarly, when reading files, you can use the global variable to reference the SharePoint folder path.

    Make sure that users have the necessary permissions to read and write to the SharePoint folder.


    References:

    0 comments No comments

  2. RaytheonXie_MSFT 38,036 Reputation points Microsoft Vendor
    2025-01-13T02:51:41.5633333+00:00

    Hi @Gregg Taylor (WH),

    Since your issue is about VBA, and our forum focus on SharePoint C#. I will recommend you to raise a new ticket in Microsoft Community Hub. There is a section dedicated to discussing VBA. You might get some more professional advice there. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.