Displaying Image in Main Report Through Sub Report

essence

Registered User.
Local time
Today, 11:42
Joined
Nov 20, 2006
Messages
21
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?
 
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

Code:
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
 
I tried but I'm still not getting the image to be displayed through the main report.
 

Users who are viewing this thread

Back
Top Bottom