Displaying Images From The Internet On A Form

Blazin J

New Member
Joined
Mar 21, 2004
Messages
44
Hello,

I am using Access 2013 and I have a database with tens of thousands of records. Rather than embed image files into my Access database (which would make it very large), I have Ftp'd a lot of image files out to an internet domain. How can I display those images on a form?

On my form, I have a text box that contains the URL (e.g., http://www.abc.com/images/BB00001.jpg) to each image.

What control can I use to download/display that image on my form (using the URL data in the text box)?

The only thing I could find that looks promising is an ActiveX Control called "Microsoft Web Browser", but I don't know how to use it or know if this is the right object. If it is, what code would I need to use and where exactly would I need to put that code?

Any help would be appreciated. Thanks in advance for your expertise!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
suggest image control or bound OLE control.
However, AFAIK, Access has no built in jpeg handler (to compress/decompress) so you might have issues with using that file format, especially if you attempt to print a report with these images. Any user would need the relevant graphics filters on their pc. Your safest format would be bmp if the images are not large in file size.
 
Upvote 0
Thanks for responding and for your suggestions. It's my understanding (correct me if I am wrong) that the image control or bound OLE control will not work unless the image files are stored locally or on your network. Furthermore, using these controls to embed the images would directly increase the size of the database file.

I don't have a need to print a report with these images, so that's not a concern, but as I mentioned earlier, I have a lot of image files (several GB), so rather than inflating my database (and possibly degrading it's performance), I thought it would be better to FTP those image files out to my domain on the internet and then "link" to them in the Access database. Hence, my approach using the Microsoft Web Browser ActiveX control. This keeps my database small and downloading the images from the internet to the Web Browser control is acceptably fast.

After several trials and approaches, I finally got it working, but the problem I now face is that there doesn't seem to be a way to zoom or resize. You simply get a browser, nothing more. So, for example, if you have a 500 x 500 pixel image, then you have to make the ActiveX control border large enough to fit it because there are no "shrink to fit" or browser zoom settings that I am aware of. The end result is that the larger the image size, the more real estate it requires on your form. Of course, I could resize (downsize) all of those images, but in my case that's not an option. So, I will either have to live with it or reconsider using the approach you suggested. Trade-offs, trade-offs...

Thanks again for taking the time to help.
 
Upvote 0
I've seen some javascript posts about getting image sizes before loading. Perhaps there is a vba or vb script method that will return the image size and allow you to resize the control accordingly. Not sure what unit of measure you would get, but I wager you could convert if necessary. I suggest that over my first thought, which would be to store the image sizes in a table, but I'd guess you have too many to deal with. That would be too bad, since it would be the logical place to store the url you need as well.
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,232
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top