Hi,
I have a report with a subreport. The records for the subreport may or may not include a photo embedded in an ole control. The number of subreport records per main report varies. I am trying to write code to assess on each record if a picture is present and reduce the height of the control to 0 and change the VISIBLE property to false if these's no photo. So on the same report, I want to end up with some subreport records with the ole control visible and some without depending on the presence of a photo in that particular sub-record. The reason for this is to remove the empty space left by a non-present photo.
I have tried the following in the subreport without any joy -
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Check if photos are present and hide if not
If (Not IsNull(oleItemPhotos1)) = True Then
Me.oleItemPhotos1.Visible = True
Me.oleItemPhotos1.Height = 5330
Else
Me.oleItemPhotos1.Visible = False
Me.oleItemPhotos1.Height = 0
End If
End Sub
Any help will be much appreciated.
Stu