<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Images on continuous forms

Published on
23,984 Points
9,384 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

Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Join & Write a Comment

Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month