Image CanShrink

H

HollyylloH

I have a database which stores the path and filename of images and the images
are then displayed on a form and on a report. Not all records in the relevant
table have a path and filename. For the records without an image, I would
like the report to not show the blank space of the imageframe. I see that
there is no canshrink property for imageframes. I have tried a number of
approaches without success. Anyone have an idea or reference material?

Thank you,
Holly
 
H

HollyylloH

Maybe more information would help? It appears to me that reports can not be
formated on a per record basis. I have tried to loop through all records and
execute a couple if statements depending on the existance of an image for
each record. It appears that the report is formated off the first record and
does not re-format each record after the first.

Maybe I could programmatically create a seperate report for each record and
then send all records at once to the printer as if they were one report. Not
sure how I would do this exactly.

This has to be a common problem any reference material would be appreciated.

Please ask if you need more information.

Thank you,
Holly
 
H

HollyylloH

I have searched high and low for a solution without success. I have read that
if I place this code:

Me!ImageFrame.Picture = Me!FilePathAndImageName

In the OnFormat event of the details section that the report will be
formatted on each record. That sounds like just what I need; however, I am
geting a "type mismatch" error with this code.
 
H

HollyylloH

Okay this is what worked:

I placed the following code into the OnFormat Event of the details section
of the report. The combination of setting the imageframe height and section
height properties to "0" (in the else part of the if statement), together got
rid of the extra blank space in the report when there is no image path
present for a record.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Not IsNull(Me.EquipPhoto) Then
Me.ImageFrame.Picture = Me.EquipPhoto
Me.ImageFrame.Visible = True
Me.ImageFrame.Height = "1000"
Else
Me.ImageFrame.Picture = ""
Me.ImageFrame.Visible = False
Me.ImageFrame.Height = "0"
Me.Section(acDetail).Height = "0"
End If
End Sub

You can still help though, got a better way to do this?
 
P

Peter YangMSFT]

Hello Holly,

I agree with you that the setting the imageframe height to 0 shall be the
good option here and I don't think there is better way to do it.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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