<

Images on continuous forms

Published on
23,738 Points
9,138 Views
6 Endorsements
Last Modified:
Approved
Very often you need to display images on continuous forms. It could be photos of employees or goods, or other images. You can use attached OLE objects, but they are very whimsical.

You can try the sample in this article:
http://access.bukrek.net/tutorial/continuous-forms
but it is very dependent on your system settings and will not work consistently.

Access 2007 and 2010 give us a modified Image control, which is able to display external images from file paths saved in our records. Advantages of this method are obvious: DB will not grow with each new image, images could be edited and replaced independently.

Let us assume we have a table with a text field containing the full path to an image: tblImagesCreate a continuous form with this field: frmImagesAdd an Image Control to the detail part of your form: image controlWhen asked about the file name, press Cancel.
Open the Image Control's properties:
Image control propertiesYou should set the Control Source to the field with path to images:
Control SourceResult you can see immediately:
form
Now we can make some improvement.
It is a good idea not to store the full path to the image, only the relative path. Using the relative path we do not need to change every record when moving the DB to a new folder or network path. We can add field to our form with path to images (of course it could be field in a table with DB parameters).
If field's name is "path", we can modify control source of our Image Control:
relativeI have added "\" between path to image folder and image name, but you will need to do it only if path is not finished with slash. You can add analysis of path as future improvement.
Included is archive with sample DB and sample images. Unpack all files to one folder and open DB. As you can see there are images in different formats (tiff, jpeg, png) and you can see all images without problems.
ImagesTest.zip
6
Comment
Author:als315
3 Comments
 

Expert Comment

by:sharonjose
this article is very useful to all.
0
 
LVL 10

Expert Comment

by:etech0
Can this procedure be used to display images from a website? (Note: I know the image paths won't change, because it's my website.)
0
 
LVL 41

Author Comment

by:als315
You can't use http://.... path, only some local (d:\....) or network(\\server1\sharedfolder\....) paths. You always should download files from website before you can show it.
0

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Join & Write a Comment

With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A query can call a function, and a function can call Excel, even though we are in Access. This is Part 2, and steps you through the VBA that "wraps" Excel functionality so we can use its worksheet functions in Access. The declaration statement de…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month