"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote in message news:<3f****************@news.west.earthlink.net>. ..
On 26 Nov 2003 14:04:35 -0800, mt****@yadtel.net (Dale Ring) wrote:
Access 2000
I am trying to print a report that only some of the records have
pictures. When the report prints, I do not want a blank image control
showing on the report. This project is a test bank of questions
allowing the user to create an exam by choosing the questions. Some
of the questions have pictures for reference and some don't.
I have chosen to keep the images in another folder with a test field
(QPic) that contains the complete path to the image. There is a
control in the detail section of the report (QPic) that contains this
path. The detail OnPrint section contains the following code:
If Not IsNull(Me!QPIC) Then
Me!imgEKG.Picture = Me!QPIC
End If
This works for displaying the images but if the question does not have
an image associated with it, the there is a blank image control
printed.
Since image controls can not "shrink", How can i print this report
(Exam) so that it does not have blank image controls?
Dale, use its Visible property.
If Not IsNull(Me!QPIC) Then
Me.imgEKG.Visible = True
Me!imgEKG.Picture = Me!QPIC
Else
Me.imgEKG.Visible = False
End If
- Jim
Thanks Jim, Great Idea!
However, this method still leaves a large blank area beneath the
question. What I need is to not have this wasted space so that the
report is more compact. There may be 5 questions that do not have
images associated with them and 5 questions that do. In this case
(with the wasted space) the report would 5 pages to print with only 2
questions per page. Without the wasted space this could be reduced to
3 pages. This would make a major difference when the exam is 100 or
150 questions.
I recall seeing a post or article about using something other than an
image control in a report to display an image. I recall that this
method did use the "shrink" property and that would resolve my issue.
However I can't locate the post or article now. It's that thing about
when you need it most, you can't find it!
Thanks
Dale