• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • Last Modified:

How to reference report control for Picture Property of Image

I have a report which, through a query, makes available a field called PictureFile.  I want to select an image by inserting that field name in the Picture Property of the Image control which will display that picture.  If I enter the bare name  -        PictureFile    -, I get an error that says that file "PictureFile" cannot be opened.  Same if I use quotes, same if enclosed in brackets,  same if brackets inside quotes.

What syntax do I use in the Picture property of an Image control to tell it to use the TEXT represented by a control on the report or on the original table, rather than the text of the control or field?

I need to do this on a report that reads many records, each of which has a different picture associated.

If someone can tell me what event changes for each new record, I could do it in VBA code.
0
netsmithcentral
Asked:
netsmithcentral
  • 2
  • 2
  • 2
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
netsmithcentral.

?

What happened to our previous posts?
(I posted that you should us an image control, then you posted that you were using PDF's)?

In any event, I have not seen ant techniques on how this can be done.

However, it can be done quite easilly in a form.

JeffCoachman
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What type of data does your field PictureFile contain? Is this an OLE field, or is this a text field that contains the path to the picture?
0
 
netsmithcentralAuthor Commented:
The PictureFile  field contains the text of the complete path and filename to the picture.

Sorry, I have no idea what Jeff Coachman is talking about.  This is my first post on this subject.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
netsmithcentralAuthor Commented:
I was able to change the picture to be displayed programmatically by using the On Page Event for the report:

Private Sub Report_Page()
Dim strFullPicturePath As String

strFullPicturePath = Reports!rptBatchPrintContract!txtImageName

'test for existence of picture file
If (Len(Dir(strFullPicturePath, vbNormal))) > 0 Then
 
'On True set property picture equal to string from txtImageName
Reports!rptBatchPrintContract!ImageFrame.Picture = strFullPicturePath

Else

'display default photo
Reports!rptBatchPrintContract!ImageFrame.Picture = "c:\database\pictures\defaultpicture.jpg"
End If

End Sub
0
 
Jeffrey CoachmanMIS LiasonCommented:
netsmithcentral,

It looks like I got this post confused with another post I was involved in.

Sorry.
;-(

So, ...Problem Solved?

JeffCoachman
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
So my post helped you to your solution, and while it wasn't a full solution you're deleting this and awarding no points ... you're the 4th one I've added to my list today ... good luck with your other questions, I'm sure you'll get sufficient assistance from the other Experts.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now