Solved

Linking image to Access report

Posted on 2014-09-11
9
209 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
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 84

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 57
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 84
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 84
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

860 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