View Full Version : Displaying Image in Main Report Through Sub Report


essence
05-07-2007, 07:29 AM
Good day,

Problem: My image files are not being displayed in my report.

I have a table that stores links to images in a folder. I have created two reports a main report and a sub report. The main report was built through the union of four tables. The subreport works fine,displaying each image for each record as is in the database. However, when I link the sub-report in the main report, no images are shown.

Code:

Here is the code on the on format of the subreport

Dim Path As String
'path to the folder with the images
Path = "C:\Documents\photos\"

If IsNull(lg_image) Then
Me![imgPicture].Visible = False
Me![imgPicture].Picture = ""
Else
Me![imgPicture].Visible = True
Me![imgPicture].Picture = Path & Me![lg_image]
End If

Can someone help?

boblarson
05-07-2007, 08:56 AM
If in a subreport, you don't want to use the keyword ME in there. That's probably what's killing it. If it works when opened by itself, but doesn't when in the main form, that is likely the main culprit. Try just using


Dim Path As String
'path to the folder with the images
Path = "C:\Documents\photos\"

If IsNull(lg_image) Then
imgPicture.Visible = False
imgPicture.Picture = ""
Else
imgPicture.Visible = True
imgPicture.Picture = Path & lg_image
End If

essence
05-07-2007, 09:50 AM
I tried but I'm still not getting the image to be displayed through the main report.