Results 1 to 11 of 11
  1. #1
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    166

    Question Store photo URL but display the photo?


    Is it possible to store an image URL in a table but display the image? (When on the form view obviously) In table view it would certainly just be a URL.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    51,028
    What do you mean by URL - web page or folder on network server? Can you provide example?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    166
    An example of a URL? is stored in the table...so when that particular record is displayed in a Form it shows up as the image, not the URL.

    Original URL was removed as suspicious---by Orange.
    Last edited by orange; 01-18-2022 at 11:48 AM. Reason: suspicious link

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    1,087
    You set the picture property of the image control.

    Code:
    Me.MyImageControlName.Picture = "The path to your image"
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #5
    dniezby is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Apr 2013
    Posts
    166
    Okay, that's a start but how do I pull "path to your image" from the table? A query maybe?

    So here is a simple example:

    SampleTable1:
    ID | Autonumber
    ProductImage| Link
    ProductName | ShortText

    Now on the form, I want the ProductImage to pull that link from the table and display it as the photo.

    Maybe an OnLoadEvent? Also, the image needs to change based on the current record. So, I guess an onloadevent wouldn't work either.

    Maybe I have to make the form off of a query then?

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    1,087
    the image needs to change based on the current record.
    Use the oncurrent event

    I dont know anything about your data or forms but you can include the path in your source query for the form or use dlookups.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    3,174
    In the newer versions of Access you can bind the image control to a field holding the path to the picture (never used web URLs but you can try and see what happens), so no VBA needed; just add the image control and set its control source=ProductImage

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    10,644
    Thanks Orange. FYI to others: the site either attempted to hack my pc or was phishing. Rebooted and performance is slow. Doing a complete scan now.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    51,028
    Field type is "Link" - do you mean Hyperlink? Setting ControlSource to Hyperlink field won't work. I doubt setting Picture property will either. I've never used VBA to set Picture property. I use ControlSource property.

    An Access hyperlink is composed of 3 parts separated by # character. You can see the parts if set textbox ControlSource to =ProductImage - include the = sign. Even then might not see a full path if is a folder.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    dniezby is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Apr 2013
    Posts
    166
    I DID IT!

    So, my goal was to add photos to my table without storing the actual file to keep DB size down. So, what I did was use a few of the ideas in this thread to make it happen.

    ---------------------------------

    Okay, so what I did was add a ShortText Field for ProductImage

    In the table, it stores a plain text URL to a photo. EG:
    Code:
    https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Immature_jalapeno_capsicum_annuum_var_annuum.jpeg/330px-Immature_jalapeno_capsicum_annuum_var_annuum.jpeg
    Then on the form, to view the product, I want it to show the image. So, I inserted a browser control. I turned off scrollbars set the Source Property to =ProductImage

    BOOM! It loads the image from the URL and it is record specific. No VBA or even a macro needed.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    51,028
    So that answers my first question - this is URL to web page image. Yes, an Image control does not work and Web Browser Control does. They both have ControlSource property.

    Web Browser Control will also show images from folder but what you don't have is SizeMode property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Text Box Wrapping around A Photo
    By Charles Hobbs in forum Forms
    Replies: 1
    Last Post: 10-19-2020, 12:51 PM
  2. Replies: 1
    Last Post: 11-08-2019, 10:53 PM
  3. Replies: 1
    Last Post: 11-21-2018, 05:02 PM
  4. Why does photo repaint twice?
    By Bazsl in forum Forms
    Replies: 7
    Last Post: 07-25-2016, 03:16 AM
  5. How to set an image for a photo directory
    By eninen7 in forum Access
    Replies: 3
    Last Post: 01-11-2011, 12:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums