Pictures in Reports

bonekrusher

Registered User.
Local time
Today, 08:09
Joined
Nov 19, 2005
Messages
266
Hi All,

I have a query (viewPhotos4record) which has a field (imagepath). "imagepath" is where the photos are located for this query (/images/filename.jpg). I am trying to view the photos in a report, but not having any luck. I can't figure out how to call them up.

Any ideas

Thanks,

Bones
 
On the INSERT menu on the report, insert a picture.
Insert the picture you want.
 
I understand how to insert a picture, I am trying to insert pictures based on a query. Any ideas?
 
Pictures

You can use the On Print Event in the report as one solution. The code below does the following:
When a part comes in it is assigned a new number..let's call it 123. We take a picture of it and call it 123.jpg and store it in S:\images. In the detail part of the report we have a text box referencing cardnumber (for instance 123) which is a field in the query. In the report I placed an image called me.image29. The pictures will be assigned to this field.


Dim APicture As Variant

APicture = "s:\images\" & Me.CardNumber & ".jpg"

If Dir(APicture) <> "" Then 'a picture exists for this part on the S Drive
Me.Image29.Picture = APicture
Else
Me.Image29.Picture = "S:\images\default" 'picture doesn't exist for this part so just assign it a picture of a default box( or whatever)

End If


Hope this helps. It depends on how you named your pictures.
 
Pictures in Report

With a little tweaking I got it. thanks for the help.
I created a Report based on the table which holds the path (imagepath). I inserted an image frame named "imageframe".


Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  
     Dim Path As String
     Dim location As String
    
        Path = Me.Application.CurrentProject.Path
        location = Path & Imagepath
        Me![Imageframe].Picture = location

End Sub
 

Users who are viewing this thread

Back
Top Bottom