Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-02-06
6
Medium Priority
?
971 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
[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
  • 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 1500 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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