Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Web site as source for image control (2000/2003)

    I have a form with an image control that I use to display .jpg, .gif, etc. files by saving the full path and filename in a text field in a table. I would like to move the image files to a web site. While testing with the images on the Web site, I get error 2220, "{Project Name} can't open the file" 'http://.../imagefile.gif'
    when I try to assign the URL for an image file to the image control's picture property.

    The code works fine if the image file is stored on a network file server or my hard drive.
    Example code:
    Me.imgA.Picture = HyperlinkPart(Me.ImageHLA, acAddress)

    Do I first need to copy the file, in code, from the Web site to, say, my hard drive and then assign that location to my image control's picture property? Or, is there another way?

    Thanks in advance for any ideas.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web site as source for image control (2000/2003)

    You can use the Microsoft Webbrowser control (click More Controls... on the Toolbox) and use code like this:

    strWebAddress = "http://www.google.com/images/logo_sm.gif"
    Me.WebBrowser1.Navigate2 strWebAddress

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web site as source for image control (2000/2003)

    Thanks Hans,
    I'll give it a try and you know how I do.

  4. #4
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web site as source for image control (2000/2003)

    The WebBrowser control does work on forms when I have just a single WebBrowser control, but when I try to use it on a report my application crashes. Also, when I have more than one of these controls on a form, the app crashes or issues an "Out of stack space" error

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Web site as source for image control (2000/2003)

    Why would you need multiple instances of the control on your form? Normally, you would only use a single instance and simply change the url to point elsewhere.
    Charlotte

  6. #6
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web site as source for image control (2000/2003)

    I would like to display four different images simultaneously - I suppose I could rework to handle differently.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web site as source for image control (2000/2003)

    A webbrowser control on a report makes no sense. The control would have to navigate to all URLs at once.

    I fear that you will have to download the images and use an image control.

  8. #8
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web site as source for image control (2000/2003)

    Can I download the images using code behind the report object?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web site as source for image control (2000/2003)

    Possible, but I think it would be horrible. The report would be really slow, and the images would be downloaded each time the report is opened. If the images change all the time, you should ask yourself whether an Access report is the ideal tool to print them.

  10. #10
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web site as source for image control (2000/2003)

    Hans and Charlotte,
    Thanks for your help (and time) on this. The reason I was exploring hosting the images on our intranet was in the hopes of improving performance over storing them on a network file server. Our report printing, at times, is painfully slow as we often have 20 to 30 images that are included in a report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •