Display a Sharepoint image in MS Access 365

Fryxelius, A.b.F. (Abram) 1 Reputation point
2021-07-29T07:55:23.88+00:00

Hi,

I'm setting up an Access client that helps me keep track of company inventories. It fetches its tables from a Sharepoint library "Docs" (for documents and general pictures about the inventories, about 20 000 files) and a Sharepoint List "Objects" for the inventories. I have managed to build a form where you can select an inventory in the Objects table and can see the corresponding files in the Sharepoint library (all files within a folder named as the Objects Primary key). The Client will eventually be distributed to my colleuges.

Now I want pictures in my forms and reports and would like some advice on how to best set this up. I would like a picture of the object itself "Overview", and a picture that shows its location "Map". My options are as follows;

1. Place the pictures in the SP library. Create fields "Overview" and "Map" in the Objects table, that contain a link to the pictures.

Pros:

Pictures are available when browsing the Sharepoint library

Logical setup

Cons:

Seems like the image control cannot use URLs as data source.

2. Open the Sharepoint list "Objects" in a browser, add column Image, name it "Overview" and add the image.

Pros:

Picture is easily accessable in Sharepoint List

Cons:

In MS Access, the field is converted to an empty text field.

3. Add the images as attachments to the "Objects" records

Pros:

There are workarounds using VBA to make attachments visible in an image control, but I'm not sure they will work with Sharepoint tables.

Cons:

This makes a large database, it will get slow, and possibly hit the limitations of size in Access

The attachments needs default names or default order so that Access can figure out which attachment goes to what purpose.

Do you have a functional setup of Sharepoint pictures using MS Access and displaying those pictures in forms and reports? How do you do it?

I have tried to use Experts Exchange method to fetch and URL image to cache and display it. See https://www.experts-exchange.com/articles/29679/Show-pictures-directly-from-URLs-in-Access-forms-and-reports.html

It was last updated in 2017, but doesn't work now, as the cached images are saved in .htm-format, not in the original image format (.gif or .jpg). Maybe there is a setting to change this?

I would really appriciate your help!

EDIT:
This question was raised by me at: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_other-mso_o365b/display-a-sharepoint-image-in-ms-access-365/c8aaa8a9-b673-492f-8efe-03a580f59201?messageId=63f5c05a-2c03-4f77-8fca-b0b2fbeac985

Moderator suggested:
According to your description, you can try the suggestions mentioned in the following discussions:

  • Display image in Access report from a SharePoint list
  • Access Form : import picture from SharePoint - Stack Overflow

My answer:
The first one offers two work-arounds.

First, use a web browser control instead of the image control. The Web Browser control is not available in Reports, so I will not be able to actually print or make pdfs. The control is also missing when trying to print a form. The Web browser control also doesn't do any resizing of the image to fit nicely on the form. So the Web browser is no good for distributing or viewing the pictures, unless there are some tweeks to fix these issues?

The second work-around is to use the attachment field and make it show the icon of the image. This makes the database very large quickly, can only show one picture, and requires that there are no other attachments. Though it is possible, it seems like it will be a mess to take care of, and at a big cost in terms of loading time and database size.

The second link actually does not provide any solution. It seems to be a speculation that it might work. It requires webdav to be enabled on each client, so every end user needs to tweek their settings, wich is virtually impossible in a corporate network. Here it is only allowed with ITadmin-logon. the Webdav documentation doesn't show default on/off features in Windows 10, so I cannot work on this solution.

Moderator refered to this forum.

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
899 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. DBG 2,376 Reputation points
    2021-07-29T20:29:25.283+00:00

    Hi. I really have no solution for you, but what do you mean by "cached" image? Are you saying when you upload an image file to SharePoint that it gets converted to htm file?

    I would have thought the URLDownloadFile approach would actually download the file as long as you provide the correct URL to it.

    0 comments No comments

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.