I am doing some experimenting and I am having problems displaying images with
a relative path. In the Northwind sample database (Access 2003), there is an
Employees table that has a field named Photo. The external photos are in the
same folder as the database so just the file name is entered in the table
field (EmplD1.bmp, EmplD2.bmp, etc.). But if I were building a database, I
would want the photos to be in a separate folder, so I created a folder and
named it "Photos" and moved photo files into that folder. Now I returned to
the Employees table and changed the contents to the Photo field to
"photos\EmplD1.bmp." My photos will not display with this relative path. An
absolute path works but not a relative path. The absolute path is as follows:
C:\\Program Files\Microsoft Office\OFFICE11\SAMPLES\photos\EmplD2.bmp
Douglas J. Steele - 20 Jan 2008 17:45 GMT
As you've found, Access doesn't work with relative paths.
What you need to do is determine the location of the folder and recreate all
of the paths to point to the correct location.
Part of why you can't rely on relative paths with Access is that you can't
be certain of to what the path would be relative! Depending on how you open
the application, the current directory will be different.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
>I am doing some experimenting and I am having problems displaying images
>with
[quoted text clipped - 15 lines]
>
> C:\\Program Files\Microsoft Office\OFFICE11\SAMPLES\photos\EmplD2.bmp
Bob Quintal - 20 Jan 2008 17:47 GMT
> I am doing some experimenting and I am having problems displaying
> images with a relative path. In the Northwind sample database
[quoted text clipped - 11 lines]
> C:\\Program Files\Microsoft
> Office\OFFICE11\SAMPLES\photos\EmplD2.bmp
When I want a relative path, I use
left(application.CurrentDb.Name, _
len(application.CurrentDb.Name) _
-len(dir(application.CurrentDb.Name)))
and prepend that to the relative path and file I want.

Signature
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from http://www.teranews.com
Tom Wickerath - 20 Jan 2008 21:43 GMT
This sample, still a work in progress as time is available, may be helpful to
you:
http://www.accessmvp.com/TWickerath/downloads/ImageDemo.zip
Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
> I am doing some experimenting and I am having problems displaying images with
> a relative path. In the Northwind sample database (Access 2003), there is an
[quoted text clipped - 8 lines]
>
> C:\\Program Files\Microsoft Office\OFFICE11\SAMPLES\photos\EmplD2.bmp