images in reports

  • Thread starter Thread starter Russell Hayes
  • Start date Start date
R

Russell Hayes

Guest
Hi,
Can anyone point me in the right direction?

I am trying to link images to a report that are different for each record.
I have tried making the data field type "OLE object" and linking the image to the report, but I have reached a 1 Gigabyte size of database and no more data can be added.

I can list the paths to the images O.K. in the data field but am having difficulty in viewing the images in the report. I keep seeing the same image.

I have followed microsoft's help files but I can only see the same image in every record not different images.

Any ideas?

Russell
 
If the images are referred to on the table/query you need to make sure that they are referred to in the report or underlying query.

Hope that helps.
 
Thanks but I'm not sure what you mean.

I think I may have solved the problem and for other's benefit I will explain.

Format a column in a table to text and store the paths to the images here.

I created an image box on the report where i wanted the image to appear.
Access then asked for a path to the image, here you can choose any path to any image as it will not be used, see next statement.

Double click the new image box to show the property box.
Choose the "All" tab and rename the image box to whatever you want, say "myimage". remove the path to the one chosen ealier.
Access asked you if you want to remove this, say "Yes"
Change the picture type to "Linked" and Size mode to "Zoom"

Click on the box where the rulers meet at top left of report.
Click event tab then On one of the lines choose "choose Builder" and the "Code builder" to open up visual basic.

Enter the following code.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error Resume next
Me.myimage[you image name].picture = Me.column[column where paths are stored].Value
End Sub

Private Sub imagepath_afterupdate()
On error resume Next
Me.myimage.picture = Me.column.Value
End Sub

Close the visual basic screen and return to the report.

Preview the report and things should now work.

I hope this helps someone as it took me a long time to find the answer and in looking found several people with the same problem i.e. Bloating the database by linking to the image.
 
Tried it

I have tried this method and i get the message

Run-time error '2220':
Microsoft Office Access can't open the file 'C:\Work\Allun Burns'.

But if i insert an image into the report and set the picture property to the above file it opens fine. The code i used is:

Code:
Me![Image10].Picture = Me![Image]
 

Users who are viewing this thread

Back
Top Bottom