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.
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.
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.
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
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
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?
Use the oncurrent eventthe image needs to change based on the current record.
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
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,
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.
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.
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: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 =ProductImageCode:https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Immature_jalapeno_capsicum_annuum_var_annuum.jpeg/330px-Immature_jalapeno_capsicum_annuum_var_annuum.jpeg
BOOM! It loads the image from the URL and it is record specific. No VBA or even a macro needed.
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.