By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Adding Images to Reports from File Paths

P: n/a
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

Aug 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <de**********@yahoo.comwrote in message
news:11**********************@g12g2000prg.googlegr oups.com...
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

Aug 7 '07 #2

P: n/a
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

Aug 8 '07 #3

P: n/a
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" <de**********@yahoo.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
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.

Aug 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.