Image Control's "Picture" property doesn't allow a URL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to populate the path to my Image Control with a URL path instead
of a UNC path, but it returns an error saying it cannot accept internet
addresses. The picture files are only available on my company's internal web
site at a path such as this:

http://lawson/lawson/deptnet/images/employees/01023.jpg

Is there a way to utilize the Image Control with a URL or is there another
control that I can use that will? I did find a WebImage Control that works
with URL's but it isn't registered on the multiple Citrix servers, so I was
hoping to find a control that is standardly packaged that will likely be
there. Thanks in advance.
 
The easiest solution might be to use the Microsoft Web Browser ActiveX
control which is available on systems with Internet Explorer.

Alternatively, a code solution using the standard Access Image control
is here:
From: Stephen Lebans
([email protected])
Subject: Re: Images on an Access Form


View this article only
Newsgroups: microsoft.public.access.formscoding
Date: 2004-05-23 19:58:06 PST


Hi Allen,
I have never worked in this area before so I just had a quick peak at
the issue tonight. You cannot place a URL in the Picture prop of a
standard Access Image control so it's either use the Hyperlink method
you outlined or some method to download the image to your local disk and
then load that image intot he Image control.


I placed the MS INternet Transfer control on an Access Form. I added a
CommandBUtton and an Image control.


Private Sub cmdDload_Click()
On Error GoTo Err_cmdDload_Click
Dim sUrl As String
sUrl = "http://www.lebans.com/images/Hillcrest 4x5grey.jpg"


Dim binarydata() As Byte


binarydata() = Me.ActiveXCtl1.OpenURL(sUrl, icByteArray)


Open "C:\TEMP\image.jpg" For Binary Access Write As #1
Put #1, , binarydata()
Close #1


Me.Image3.Picture = "C:\temp\Image.jpg"


Exit_cmdDload_Click:
Exit Sub


Err_cmdDload_Click:
MsgBox Err.Description
Resume Exit_cmdDload_Click


End Sub




--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top