I am building a report for an MS Access database. The report contains a subform that lists information about items, including an attachment field that holds images.
If there is no attachment, the row space is still used by the object, resulting in a lot of unnecessary empty space in the report.
I need to resize the object to 0x0
and also resize the Details section of the subreport if there is no image.
I have found that I could use the following command to determine if there is an image present but do not know which Event to put the statement in or what additional syntax will be required:
Me.attachPhoto.AttachmentCount
I found the following example code for resizing the attachment/image object that I think I could modify to get working, but do not know which Event to place it in:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If IsNull(Me!Image20) Then Me!Image20.Visible = False Me!Image20.Height = 0 Me!Image20.Width = 0 ElseIf Not IsNull(Me!Image20) Then Me!Image20.Visible = True Me!Image20.Height = 2880 Me!Image20.Width = 2880 End If End Sub
Assuming I can figure out where to place the code and can get it working, I still don't know how to change the size of the Details section of the subreport.