Image Help

I

Image Help

So I've read lots of the material that has been referred to here about linked
vs. embedded images. Thanks to all the helfpul info, I have successfully
created a form that shows images that I've created the paths for in a table.
But now I have two issues:

1. If I have a table entry without an image, the form displays the previous
image. I developed a workaround which I'm sure is not very efficient, which
was to create a "blank.jpg" file and use that file name for every record
without an image. Does anyone have any better suggestions?

2. I added all the file name/file paths for the existing records that I
already have images for. But, in the future, as new data come in, when new
records are added through my form, I want to be able to add the new file name
and file path in the form. Right now, the method I use just shows the
existing images that I have already set up in my table. And if I try add a
new record, it shows the last image viewed (similar to issue #1).

I hope this makes sense. Any help greatly appreciated!

Wendy
 
D

Daniel

1. I have done the same in the pass and it works fine. Another method is to
simply make the control not visible (visible=false) when it does not have an
image entry.

2. I'm afraid I didn't follow your explanation. Could you spell it out one
more time.
 
L

Larry Linson

Image Help said:
1. If I have a table entry without an image, the form displays the previous
image. I developed a workaround which I'm sure is not very efficient, which
was to create a "blank.jpg" file and use that file name for every record
without an image. Does anyone have any better suggestions?

As Daniel noted, this is a method often used, or, as he also suggested,
simply setting the Visible property of the Control to False.
2. I added all the file name/file paths for the existing
records that I already have images for. But, in the
future, as new data come in, when new records are
added through my form, I want to be able to add the
new file name and file path in the form. Right now,
the method I use just shows the existing images that
I have already set up in my table. And if I try add a
new record, it shows the last image viewed (similar
to issue #1).

The code in the examples referenced below uses the API to employ the Windows
File Open/Save dialog box http://www.mvps.org/access/api/api0001.htm to
locate a file.

Please note that the examples below apply to Access 2003 and earlier.
Improvements in Access 2007 eliminate the bloat with OLE Objects, but do not
resolve all the other issues that can arise from requiring another software
package to display the image.

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
 

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