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
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