"Image Help" <Image XXXX@XXXXX.COM > wrote
> 1. If I have a table entry without an image, the form displays the
> image. I developed a workaround which I'm sure is not very efficient,
> 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.yqcomputer.com/
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://www.yqcomputer.com/
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.yqcomputer.com/
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.
Microsoft Access MVP