Display image at run time

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

I designed an inventory report for a photography
database. The report lists all pics in inventory by ID
Number. I have a separate file folder location containing
similarly named jpeg files of each pic by ID number.

e.g. ID Number name= MC5-15, Image name= MC5-15.jpg

How do I get the image of each specific ID Number to show
in an image control or other object on the report? There
should be one specfic image for each specific ID.

Thanks.
 
JD,

Drop an image control onto your report. It will need to
point at an image somewhere in your file system (eg.
c:\images\default.jpg). Don't worry that this is not the
desired picture at this time.

You will now need to set the picture property to the
desired image.

Dim isig As String
isig = "c:\images\"&[signature]&".bmp"
[Image25].Picture = isig

This creates the string that makes up the path to the
desired image (in this case to a signature bitmap image).
Substitute your path and field name and the image control
name. UNC pathing works and may be better if the app is to
be distributed to other users on the network.

This will need to go into the section where the image is
(detail section, group header, group footer or where ever)
on the "on format" event for that section.

If you need to scale to thousands of pages in your reports
(with images) Access will have problems. Bitmaps (for some
reason unknown to me) scale much better than other image
formats. I can get to about 10,000 pages with an image a
page using bitmaps and only about 3,000 using EPS images.

HTH,

Terry
 
Thanks very much Terry. I'll give it a try.

JD
-----Original Message-----
JD,

Drop an image control onto your report. It will need to
point at an image somewhere in your file system (eg.
c:\images\default.jpg). Don't worry that this is not the
desired picture at this time.

You will now need to set the picture property to the
desired image.

Dim isig As String
isig = "c:\images\"&[signature]&".bmp"
[Image25].Picture = isig

This creates the string that makes up the path to the
desired image (in this case to a signature bitmap image).
Substitute your path and field name and the image control
name. UNC pathing works and may be better if the app is to
be distributed to other users on the network.

This will need to go into the section where the image is
(detail section, group header, group footer or where ever)
on the "on format" event for that section.

If you need to scale to thousands of pages in your reports
(with images) Access will have problems. Bitmaps (for some
reason unknown to me) scale much better than other image
formats. I can get to about 10,000 pages with an image a
page using bitmaps and only about 3,000 using EPS images.

HTH,

Terry

-----Original Message-----
I designed an inventory report for a photography
database. The report lists all pics in inventory by ID
Number. I have a separate file folder location containing
similarly named jpeg files of each pic by ID number.

e.g. ID Number name= MC5-15, Image name= MC5-15.jpg

How do I get the image of each specific ID Number to show
in an image control or other object on the report? There
should be one specfic image for each specific ID.

Thanks.
.
.
 
Back
Top