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

x
?
Solved

How to reference report control for Picture Property of Image

Posted on 2008-10-13
6
Medium Priority
?
458 Views
Last Modified: 2013-11-28
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
Comment
Question by:netsmithcentral
[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
  • 2
  • 2
  • 2
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22709026
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
 
LVL 85
ID: 22709824
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
 
LVL 12

Author Comment

by:netsmithcentral
ID: 22712255
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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 12

Accepted Solution

by:
netsmithcentral earned 0 total points
ID: 22714223
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22715385
netsmithcentral,

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

Sorry.
;-(

So, ...Problem Solved?

JeffCoachman
0
 
LVL 85
ID: 22715927
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

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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