Open attachment using Microsoft Web Browser in a Form (1 Viewer)

ryanw1986

New member
Local time
Today, 17:47
Joined
Feb 29, 2020
Messages
1
Hi all.

I have a table in a database and each record has only 1x attachment (generally a PDF).

I need a form which has a Microsoft Web Browser on it that will show the relevant attachment.

Have seen similar posts for attachments using a file picker which doesn't work for me, all I want is to show the attachment on the actual record.

Thanks for any help.

R.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:17
Joined
Oct 29, 2018
Messages
21,467
Hi. If you're talking about an Attachment field, I think it would involve extracting it to a temp folder first before you can display it in a web browser (or even a bound object frame) control.
 

HiTechCoach

Well-known member
Local time
Today, 03:17
Joined
Mar 6, 2006
Messages
4,357
Hi. If you're talking about an Attachment field, I think it would involve extracting it to a temp folder first before you can display it in a web browser (or even a bound object frame) control.

I agree.

Exporting the attachment is the only way I could get it to work in a Web Browser Control (WBC)

Why? Great question ... and the reason ...

Web Browsers only show files from the hard drive. Every web page is cached (downloaded) to the local computer's hard drive. The files are then loaded into the from the hard drive into the browser viewport for display. Even video streams must first download a program (code) to allow the stream to be viewed.

I have been using the Web Brower Control (WBC) it displays lots of differnt file types from disk by taking advantage of the capabilities of IE.

IIRC, the attachment field data type was added for Access Web apps published to Sharepoint. I do not use it for anything I create for the Desktop. (I only use Access on the desktop)
 

isladogs

MVP / VIP
Local time
Today, 09:17
Joined
Jan 14, 2017
Messages
18,216
Have a look at this example file viewer app. It allows you to view various types of file in a Web browser control within Access.
Depending on your Access version, you may need to run the .reg file included in the attached zip file to ensure files are opened within Access rather than externally
 

Attachments

  • SampleFileViewer.zip
    239.7 KB · Views: 174

Users who are viewing this thread

Top Bottom