Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding Images to Reports from File Paths

1 view
Skip to first unread message

Dean

unread,
Aug 6, 2007, 11:45:42 PM8/6/07
to
Hi,

I'm trying to add images to a report, pointing to a field in a query
containing the file path (a combination between a string value and an
existing field). There's nothing wrong with the path, but for some
reason I get a message saying it can't find the field "IMAGE_PATH".
I'm using the following code, which should work:

Me!ImageFrame.Picture = Me.IMAGE_PATH.Value

The field is in my list and I even get it popping up when coding, as a
valid field to use.

What am I doing wrong? Should I be pointing at the query differently?

Cheers

Dean

Larry Linson

unread,
Aug 7, 2007, 12:39:52 AM8/7/07
to
In Reports, Access is "smart" and even though the Field may be in the Record
Source, if it is not the Control Source of a Control, it will not be brought
along at runtime. Using it in VBA code, as you are, is not enough. Add a
Control to your Report, bound to IMAGE_PATH, and set its Visible property to
No if you don't want it to be seen. (Don't name the Control the same as the
Field, IMAGE_PATH, so as to avoid any possible confusion -- txtImagePath
should work nicely.)

I'll wager you won't have the same problem after that. If you do, refer to
that Control, instead of the Field itself.

Larry Linson
Microsoft Access MVP


"Dean" <deanca...@yahoo.com> wrote in message
news:1186458342.1...@g12g2000prg.googlegroups.com...

Dean

unread,
Aug 8, 2007, 12:30:20 AM8/8/07
to
Hi Larry,

Thanks for the reply! I got this working with your suggestion, BUT
(yes, you just knew this was coming...) I get a run-time error 2114
saying that it can't use the image... 'blah-blah.jpg'. Now, I know
for a fact that I've done this with the same images before and they're
all JPEGs. Also, it gives that message for a different image
everytime. I have 574 images in total.

What could this issue be?

Cheers

Dean

Larry Linson

unread,
Aug 8, 2007, 12:04:14 PM8/8/07
to
Could it be that the graphics filters were, for some reason, not installed?
That's about all that comes immediately to mind.

If you have 574 images, you may well have to take a look at 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.

But, I can't remember trying a report with many pictures, not using that
technique, or files that already were bitmaps, since Access 97... the memory
leakage problem _could_ have been corrected. Stephen also has a freely
downloadable Control that might be of Help -- I haven't used it in a Report,
either, but I have a lot of confidence in Stephen's work.

Larry Linson
Microsoft Access MVP

"Dean" <deanca...@yahoo.com> wrote in message

news:1186547420.8...@i13g2000prf.googlegroups.com...

0 new messages