Show pictures in subform Ms Access 2007

leeuwa

New member
Local time
Today, 20:15
Joined
Oct 6, 2009
Messages
1
I (Ms Access rookie) want to make a form with a subform, on the continues subform I want to display some data along with a picture.

In VBA I have:
Me![imagepath].SetFocus
Me![imageframe].Picture = Me![imagepath].Text

[imageFrame] is the name of the picture control, [imagePath] is the name
of the text field that holds the path to the jpg.

What I want is each record in the subform to show the associated
picture, what I get is all records showing the first picture.

What is the problem? How can I (easely) solve this problem?
Any suggestions would be appreciated.
(I can mail the example, I can't upload as attachment).

There was a simular question in 2007 on another forum (http://dbaspot.com/forums/ms-access/350840-display-pictures-continues-sub-form.html), but the answer was not satisfying.

I hope that someone can help me with this.
Thanks in advange.
 
A continuous form has multiple copies of the same controls. When you address a control property it applies to all the copies.

I think you need a bound object frame rather than a picture but I have never done this.
 
Hi leeuwa

I've been playing with continuous forms a bit recently (Access 2003, not 2007), and my understanding is that any control needs to be bound to the underlying table/query in order to show 'per record' data. So, if you can get your pictures in the database, and bind the pictureField to the picture control then each row on your form will show the expected picture.

The way I understand this is as follows:
You've got code that reads:
Code:
Me![imageframe].Picture = Me![imagepath].Text
but in order to get multiple pictures on the form you'd need
Code:
Me![imageframe0].Picture = Me![imagepath0].Text
Me![imageframe1].Picture = Me![imagepath1].Text
...

From what I've read, if you don't or can't get your pictures from the database, you're signing up for a lot of coding.

cheers
mcalex
 

Users who are viewing this thread

Back
Top Bottom