Image on a continuous form

  • Thread starter Secret Squirrel
  • Start date
S

Secret Squirrel

I'm trying to make a list of my employees using a continuous form. I also
want to show the image on this form as well. I have a single record form that
when you select an employee it shows their image. Here is the code I'm using
on the single record form:

Function setImagePath()
Dim strImagePath As String
On Error GoTo PictureNotAvailable
strImagePath = Me.memProperyPhotoLink
Me.memProperyPhotoLink.Locked = True
Me.memProperyPhotoLink.Enabled = False
Me.ImageFrame.Picture = strImagePath
Exit Function
PictureNotAvailable:
strImagePath = "C:\NoImage.gif"
Me.ImageFrame.Picture = strImagePath
End Function

I have this function firing in the OnCurrent Event of the single record form.
How come when I try to use this code on the continuous form it won't work?
When I put this code in the OnCurrent Event on the continuous form it will
show the same picture for all the records. When I open the form the first
record in the list is selected so it shows their picture for every employee.
Is there something different I need to do on a continuous form? The pictures
are linked to my database, not stored within the database. The
"memProperyPhotoLink" control is where the path to the picture is stored.
 
L

Larry Linson

You have discovered how continuous form view Forms work. There is one
detail section, and copies of it. If the Fields are bound, they will have
different data... if unbound, whatever is in the "current record" will
display in all the copies. As far as I know, the only way to display
pictures on each record of a continuous forms view form is in Bound OLE
Frames. Access 2007 is supposed to have overcome some/all of the bloat that
used to be associated with storing OLE Objects in your DB, by eliminating
the bitmap thumbnail that previous versions create for OLE Objects. And, of
course, you can have linked tables in more than one 2GB database that you
use as a back-end datastore.

Larry Linson
Microsoft Office Access MVP
 
D

Douglas J. Steele

That's the way continuous forms work. Unless the control is bound, setting a
value for one instance of the control changes all instances of it.
 
S

Steve Schapel

Squirrel,

Larry is correct in mentioning that Access 2007 provides better options.
In fact, it's even better than he suggests. In Access 2007, an Image
control has a Control Source property, which means what you are looking
for is very easy to attain. But I guess you are not using 2007?
 

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