Display jpg image in a report using a variable

By seamanrl ·
I'm using Access 2007. I've successfully created reports using the steps outlined in Microsoft Q285820 (;en-us;285820).

Use the following code in a form that shows a prodcut picture. Rather than store the same path several hundred times, I pull the path from a specific record using DLookup. It work great on the form! What I can't figure out is how to modify the code/module from Q285820 to do the same thing in a report. Any suggestions would be greatly appreciated!

strPhotoPath = DLookup("PrefDetail", "Preferences", "ID=2")
strProductName = Me.[Product Name]
strType = Me.Type

BTW, I've used a simple bit of code to display the pictures (below), but the pictues are extremely grainy! I'm assuming that access automatically converts them to bitmaps...?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me![Imageframe].Picture = Me![Imagepath]
End Sub

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Image quality

by seanferd In reply to Display jpg image in a re ...

Does the image become stretched or zoomed? I don't think Access will resample the image when resizing.

Collapse -

Image quality

by seamanrl In reply to Image quality

Good question and one I hadn't considered! Thank you for suggesting it.

When the Size Mode property is set for Zoom or Stretch to quality is distorted. When set for Clip, what can be seen of the image is fine. Resizing the images is a do-able workaround, but not really practical for the long-term ease of use...

The advantage of the DisplayImage function is that Zoom works with any size image and displays it without distortion. I'm still hoping for a suggestion on modifying that code!

Related Discussions

Related Forums