Linked images and Path

W

Wanadoo

Hi,

based on the NorthWind example, I've created a simple catalog application
(Access XP) with linked images stroed in a directory tree

C:\myappli\images\product1,
C:\myappli\images\product2,
...

In order to be bale to move my application to another disk or to distribute
it on CDs, I'd like to make my path independant from the drive letter.
How can I achieve that?

Thanks for help

Louis
 
R

Roger Carlson

Store only that part that is lower in the directory structure as your
application. I am assuming they will be stored in a subfolder beneath your
application. The following code:

Function ThePath() As String
Dim FileName As String
FileName = CurrentDb.Name
Thepath = (Mid(Filename, 1, Len(Filename) - Len(Dir(Filename))))
End Function

will return the path where your application resides to the variable
"ThePath". Then simply concatenate your stored portion to ThePath:

ThePath()&"\images\product1"
 

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