very strange problem while trying to show multiple images in a report.

A

Anja

Hi everyone,

I have a very strange problem happening when I try to show images on
my report.

So, my control source contains paths to images on the disk. This can
be NULL, in which case the picture control should not show an image.
The control source field is 'Photo' and the image control is called
Image32.

So, I have the following event handler:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Not IsNull(Me.Photo) Then

If Len(Dir(Me.Photo)) > 0 Then
Me.Image32.Picture = Me.Photo
Else
Me.Image32.Picture = ""
End If
Else
Me.Image32.Picture = ""
End If
End Sub

The problem is that as soon as one of the current record has a valid
image, all the subsequent records in my report contain that image!

So, I have 6 records...the first 2 contain NULL records and they show
up ok. Then I have a valid image, followed my 2 invalid images and
another null value... However, the valid image shows up on all 4
lines!!

Can someone tell me what I am doing wrong here. I would really
appreciate it!

Thanks,
Anja
 
D

Douglas J. Steele

Sounds as though you're using an unbound control to show the image.

While it may look as though you have, say, 20 image controls on the report,
in reality you have the same one control repeated 20 times.
 
A

Anja

Sounds as though you're using an unbound control to show the image.

While it may look as though you have, say, 20 image controls on the report,
in reality you have the same one control repeated 20 times.

Thanks for the reply! How can I make the Image control bind to a data
field???
 
A

Anja

Hello,

But does the bound object frame control need to have an OLE type as
source? My table only contains path to images on the disk, so it is
essentially a text field...

Anja
 

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