Solved

Why wont my image display image in MS Access 2003 Report?

Posted on 2013-02-06
6
922 Views
Last Modified: 2013-02-07
I am trying to display a 10 separate databound file based images in an access report.  The image name is stored in the field. The type of image is JPG. I have created a bit of VBA to find the image but it fails to display. My verbose code is as follows;

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Dim strImagePath As String
Dim imagename As String
Dim fullpath As String
imagename = "image009.jpg"
strImagePath = "../App_Images/Site/Image3/"
fullpath = strImagePath & imagename
Me!Image127.Picture = fullpath

End Sub

Open in new window

0
Comment
Question by:XGIS
  • 3
  • 2
6 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38862706
Try this:
Me!Image127.PictureData = fullpath
0
 
LVL 3

Accepted Solution

by:
nirdeshsingh earned 500 total points
ID: 38862726
Replace your backslash with forward slash if you are using your image from local computer.
Like : "strImagePath = "..\App_Images\Site\Image3\"

If still does't work then

Edit your path with "strImagePath = "..\App_Images\Site\Image3"
imagename = "\image009.jpg"

If you are on network, please check your path.

For load picture eg:-
    pic =fullpath
    Image1.Picture = LoadPicture(pic)

PS : First try the first solution, if that also doesnt work then send me the code detail and let me know that where you want to show the picture!!
0
 
LVL 7

Author Closing Comment

by:XGIS
ID: 38862917
Thanks nirdeshsingh. The back slashes were the main issue. Other issues were the event, which should have been Detail_Format. Lastly the change of ! to . and it worked. Awesome!

Unfortunately IrogSinta your solution required a dib file, but thankyou for the input.

I will try the alternate logic for network connection and delivery. MS has some worked functions for this that may be useful to determine online/offlibe status etc.

Thankyou
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 7

Author Comment

by:XGIS
ID: 38862922
Solution Code
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim strImagePath As String
strImagePath = "..\App_Images\Site\Image3\" + Me.Image3
Me.Image127.Picture = strImagePath
End Sub

Open in new window

0
 
LVL 3

Expert Comment

by:nirdeshsingh
ID: 38862972
It's My Pleasure :)
0
 
LVL 7

Author Comment

by:XGIS
ID: 38866131
If that code does not work for you and you are operating locally this code may be better as the relative paths had issues. The PC is Win7 64x and the files reside in an IIS7x .NET4 website.  Security may be an issue also if drive content has been migrated from another NTFS.  

This code successfully displays 2 images in an MS Access 2003 Report without error logic.

Private Sub Detail_Format(Cancel As Integer, PrintCount As Integer)

Dim strImagePath1 As String
strImagePath1 = "E:\Websites\XGIS\X.COM\X.COM\App_Website\App_Images\Site\Image1\" + Me.Image1
Me.imgImage1.Picture = strImagePath1

Dim strImagePath3 As String
strImagePath3 = "E:\Websites\XGIS\X.COM\X.COM\App_Website\App_Images\Site\Image3\" + Me.Image3
Me.imgImage3.Picture = strImagePath3

End Sub

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

861 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

25 Experts available now in Live!

Get 1:1 Help Now