linking images in a report - problems

S

Scott H

I have tried all of the examples listed in various post from this and other
forums. I am having no luck in getting the results desired. I have Access
2002. Here is the code I have been trying.
I want to be able to have all of the pictures with my associated database,
text field path of image, related on the report displaying the correct
picture for the member.

Placed in the Details>On Format & OnPrint Events....neither had the desired
effect. I have tried both Image Frame and Unbound OLE Image. The Unbound
OLE displays the picture of the first record with an image on all images,
then the second page of the report has the first image as the background
image for the rest of the pages of the report. Below is the simplest code I
have tried, but all the other ones that somewhat worked did the same thing.

If Len(Me.txtPicture) > 0 Then
Me.Picture = Me.txtPicture
End If

Any idears???

Thanks, Scott
 
A

Andrew Smith

Assuming you are using an image control called img, and the txtPicture
control contains the full path of the imgage file then you have the syntax
would be

me.img.Picture = Me.txtPicture

In your code I assume that you have called the control "Picture". If so then
you are missing the ".Picture" that you need to refer to the Picture
property of the control. Note that the Picture property does not show up on
the IntelliSense list, so you have to know that it exists and type it in in
full.
 
S

Scott H

Thanks Andrew, that helped out a bunch. Here is the code I am using now.
It seems to be working now.

Thanks. Scott
------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo err_Detail_Format

If Not Me.txtPicture = "" Or Not IsNull(Me.txtPicture) Then
Me.PictureImage.Picture = Me.txtPicture
Else
Me.PictureImage.Picture = "c:\church2000\pics\doodoo.jpg"
End If

exit_Detail_Format:
Exit Sub

err_Detail_Format:
MsgBox Err.Description
Resume exit_Detail_Format
End Sub
 

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