Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Get it to work. Adding an image to a report.

Status
Not open for further replies.

Scrye

MIS
Nov 6, 2002
23
US
I am relatively new to Access and I have been given the task of creating a DB that holds product information along with printing a report to use as an approval for production. I have tried everything I could find for displaying an image onto a report and nothing has worked. For the last 2 days I have read every Thread that contains anything about an image on a form or report and I cannot get the image to show.

I have inserted a picture into the report, removed the path, and changed the picture type to linked. I have inserted the following code:

[tt]Private Sub detail_format(cancel As Integer, formatcount As Integer)
On Error Resume Next
Me![Report-Photo].Picture = Me![SigLocation] & Me![ApprovedBy] & ".jpg"
End Sub[/tt]

Report-Photo is the "Name" of the picture under properties.
SigLocation is a fld with the location of the JPG.
ApprovedBy is the initials of the person approving the form and is also part of the file name. For example, the file name is AB.jpg.

I have to be missing something but am unsure as to what it is. I am desperate for help.

Thanks in advance!!!!!!!
 
Have you tried this ?
Me![Report-Photo].Picture = LoadPicture(Me![SigLocation] & Me![ApprovedBy] & ".jpg")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi,

If you take out the 'On Error Resume Next' do you get an error message?



There are two ways to write error-free programs; only the third one works.
 
Thanks for the quick response and the help.

GHolden - I had not removed the error checking on any of my tries but I did this time and realized that I had not added the field SigLocation to the Report. Once added it printed perfectly. Thanks!!!!!!!

PHV - This is the first I have seen this command (LoadPicture). I still have a lot of work on the report and more images to add so I will try your suggestion on the next version of the report.

Thank you both for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top