How to remove ImageControl blank spaces for records with no pictures ?

E

envirographics

I have a picture control in my Report, (I think I usde Image control
to create it)
properties are:-
Picture: (none)
Picture Type: Embedded
Size Mode : Zoom
Picture Alignment : Centre


It receives its images from images stored on my D drive, NOT in the
database to avoid ballistic file sizes !

Via Code button in Report Design View, it shows:-

Option Compare Database
Option Explicit

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error Resume Next

If IsNull(Me![OverallPicPath]) Then
Me![OverallPic].Visible = False
Else
Me![OverallPic].Picture = Me![OverallPicPath]
Me![OverallPic].Visible = True
End If


End Sub

The address to the image on D drive is held in field OverallPicPath,
this also sits on report page to allow pic to show.

My problem is, if the record has no picture associated with it, or yet
to be photographed, I still get a large blank space, so 50 records is
currently 15-0 pages when it could be 5 !

Can I have code that says If Null, image control shrink !

I have tried making Visible : No in its properties but oddly enough it
still shows pictures.
Could perhaps coding tell the control to not exist when record field
null.

Just how do I get rid of these blanks ?
This would be brilliant if it wasnt for this.
Thanks
Envirographics
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top