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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2003 file in 2010 - display photo on Report

Status
Not open for further replies.

sgredler

Technical User
Jan 11, 2011
1
US
I have a report based on a query. I am trying to display two photos on the form that are linked to the report via the detail "on current" event. The two photos are IMAGEA and IMAGEB.

Each record has a number (RecNum) as an identifier, and which the image is named, then contains an underscore and a 1.jpg or 2.jpg in a folder. (For example, a record with the RecNum "03A123" has corresponding photos in the folder of 03A123_1.jpg and 03A123_2.jpg.)

In loading the images from the folder, if a record does not have an image in the folder that corresponds to its RecNum, I get an error (not unexpected). The code is using the RecNum field data (I will post below). But is it possible to have something come up on the report for these images? Either a blank image or "no photo" or *something*?

This is the code in the event:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageA.Picture = "\\mhd\entp\11168-00\06001\TECH\Photos\FinalFormPhotos" & CStr(Me.RecNum) & "_1.jpg"

Me.IMAGEB.Picture = "\\mhd\entp\11168-00\06001\TECH\Photos\FinalFormPhotos" & CStr(Me.RecNum) & "_2.jpg"
End Sub

I hope that makes sense.

Sara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top