Images and Reports

G

Guest

Dear friends,

I have a report which prints images stored in a folder. Within the table I
have a field called ImagePath in which I store the path of the image. I use
the following code on Format / Print Event and works fine:
Me![ImageFrame].Picture = Me![ImagePath]
The problem is when an image is not found (although the path is recorded) I
get an error message (Run-Time error 2220).

I guess I need to have some more code in order to check if the image is
found and if is not found to show me the original picture of the ImageFrame.
What code shall I use - Please help.

Thanking you in advance,

George
 
G

Guest

You should be able to simply trap the error by adding an error handling
routine to your code


On Error GoTo ErrHandler

Your Code

ErrHandler:
if err.number = 2220 then
resume next
Else
msgbox err.number & vbcrlf & err.description
End if


You shoud look into err handling code a bit more (what I wrote is but very
basic).

Daniel
 

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