Picture on report based on only the path & filename of that picture

  • Thread starter Thread starter Christian
  • Start date Start date
C

Christian

Hello,

I have a report that shows data of an employer. There
should also be a picture of each employer on the report. I
don't save the picture as an OLE-Object in the database, I
only save to path and the filename of the employer-
picturefile in each employer-record.

In the Detail_Format event of the report I use the code:

Me.imgFoto.Picture = Nz(Me.txtFotoLink, "")

(imgFoto is the name of the picturebox and txtFotoLink is
the field which contains the path+filename).

This works fine when I use the report on one employer at a
time, but when I want to view the report on all employers,
the pictures get mixed up. The wrong picture is shown for
each employer and employers without a picture show the
picture of the previous employer.

Does anyone how to fix this?

Greetings,
Christian.
 
The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
 
Back
Top