Display jpg image in a report using a variable - TechRepublic
Question
March 16, 2009 at 10:44 PM
seamanrl

Display jpg image in a report using a variable

by seamanrl . Updated 17 years, 4 months ago

I’m using Access 2007. I’ve successfully created reports using the steps outlined in Microsoft Q285820 (http://support.microsoft.com/default.aspx?scid=kb;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 discussion is locked

All Comments