Solved

Linking image to Access report

Posted on 2014-09-11
9
202 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
Comment Utility
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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 300 total points
Comment Utility
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 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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
 

Author Comment

by:HKFuey
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 84
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 84
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now