Solved

Linking image to Access report

Posted on 2014-09-11
9
212 Views
Last Modified: 2014-09-12
I have a report with an order number e.g. '12345'. I have an image called '12345.jpeg' saved in C:\temp

Does anyone know how to embed the image in the report dynamically so when I generate it the correct image is displayed and the link works automatically?
0
Comment
Question by:HKFuey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
ID: 40316987
1. Place an image control on the report.
2. Set its picture type property to linked.
3. In the sections OnFormat event, set the Picture property of the control to the path to the image.

Jim.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 300 total points
ID: 40316988
I believe 2007 allows you to "bind" a Picture control to a filepath, so try this:

Create a query that includes a calculated field:

ImagePath: "C:\Temp" & Order_Number & ".jpeg"

Now build your report, add a Picture control, and set the ControlSource of that control to the ImagePath field in your query.
0
 
LVL 58
ID: 40316998
FYI, you might also want to check out:

http://www.ammara.com/

Which sells DBPix making image control very painless.  There is a free trial if you want to try it out.

Jim.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:HKFuey
ID: 40317095
Hi Jim,
Tried the on format, I get "error 2114 Access does not support or file is too large...." (format is jpeg)

Hi Scott,
I added the path to the query and referenced it on the control source of the image, I got no error or image.
0
 
LVL 85
ID: 40317141
Are you 100% sure the path and file extension are correct? The Picture control will simply not show the item if it can't find it, with no error. Be sure your images are actually JPEG images, and not JPG or some other format.

Also: I forgot to include the trailing backslash. The calculated field should read:

ImagePath: "C:\Temp\" & Order_Number & ".jpeg"
0
 

Author Comment

by:HKFuey
ID: 40317320
Hi Scott,
This is the actual formula: -
SigLoc: "C:\Temp2\" & [dbo_MdnMaster].[DispatchNote] & ".jpeg"

If I put the result in a web browser it brings up the image (attached)000000000551482.jpeg
0
 

Author Comment

by:HKFuey
ID: 40317323
0
 
LVL 85
ID: 40317522
See this MSFT article:

http://support.microsoft.com/kb/2479871

That points to a hotfix here:

http://support.microsoft.com/kb/968095

Looks like in some cases an update would restrict you from using certain image formats unless you've applied the hotfix.
0
 

Author Closing Comment

by:HKFuey
ID: 40319200
Thanks

Scott, I downloaded a program called TotalImageConverter, converted the files then your first suggestion works I just link to the png file.

strPath = "C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe" & " C:\Temp2\" & Dnote & ".jpeg" & " C:\Temp2\" & Dnote & ".png" & " -fo"
Retval = Shell(strPath)

The '-fo' parameter overwrites without prompt. Cost of full program TotalImageConverter about £12
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question