Continious forms again

B

Bill

Can anyone help me out!
I am trying to display a list of images from a table.
using the on current properties are great if you only want to view one image
at a time.
Private Sub Form_Current()
On Error Resume Next
Me![imagename].Picture = Me![imagepath]
End Sub
This will display one image at at time.
Great when you are looking at only a single form. Correct image in picture
When you select next you go to next record and the image changes. The path
for the image is stored in a field and changes accordingly.

That doesnt solve my problem I am wanting to display a list of records with
different images associated to each one

I have included a field which is the path to image. I have seven images in
the
table and when I display all records in a continious form the same image is
shown in all 7 records. When I navigate to the next image the image changes
to correct image but it also changes the other 6 images to the same image.
Is there a way to stop this happening. Displaying 7 different images.
Thanks!
 
M

MacDermott

An Image control is an unbound control; in the detail section of a
contituous form, it will always show the same image for all records, because
it is not bound to a record.
Your Form_Current code executes whenever you change records, and changes the
image displayed for all records.

There are a couple of work-arounds available.
1. Store your images in the table as OLE objects, and use a Bound Object
Frame to display them. This may be workable with 7 images, but it will
cause your database to grow in size considerably; if you're thinking of
expanding this to many more images, this approach may produce a very large
database quite quickly. If you choose this route, you may want to reduce
your image resolution to the minimum which will display adequately on the
screen.

2. If you just need to display the information, rather than interact with
it, you might consider using a report instead of a form. On a report, the
code you posted should work well.

3. Depending on how badly you really need to display all the images at
once, you could consider putting the image in the continuous form's
FormHeader or FormFooter section. A single image will be displayed, but it
will always match the selected record.

HTH
- Turtle
 

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