Access can't open the file "image.jpg"????

C

Chris K

I have linked an image as background to some reports - because I am
developing the database on different machines and the image is always in the
same folder I have removed the path to the image - so it just read
"image.jpg" - I've done this before extensively but for some reason I
occasionally get an error

Access can't open the file "image.jpg"????
 
J

John Spencer

Without a specific path Access won't know where the file is. I think it will
try a default of the last directory accessed in Windows Explorer. The prior
statement is just a wild guess as I really don't know for sure that is what is
happening.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
C

Chris K

Like I say - have used this methods lots times - including a database I
still have with me right now and the reports work fine in that

I'm not sure how developers get on with Access spending so much time
reconnecting report backgrounds, mail merges, and tables every time the
database moves location

I think I'll have to put the path in using code but seems overkill
 
R

Rob Parker

Hi Chris,

You could try using ".\image.jpg" as the full image path/filename. . is the
shorthand form for the current directory. This works in a quick test - I
just have to ignore the error when I actually enter it in the Picture
property of the image control.

Or you could prepend CurrentProject.Path to the image name to get around the
potential problem of hard-coding a path; you'd have to do this in code,
since it won't work as an entry in the Picture property of an image control.

HTH,

Rob
 

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