Detecting current path

M

Magius96

In many of the database applications that I've built, I have to import files
into tables. I've got everything working, but there is one minor snag. I've
had to hard code the full path to where the files would be found, but I don't
want to do that.

The files will always be in either the same directory as the MDB file, or in
the 'Attachments' directory of the same directory.

So what I need, is a way to automatically detect what directory the current
running MDB file is located in, so that if i give the DB to someone else, the
import scripts will still work properly.

Oh yeah, and if you could help me to determine the exact name of an outlook
inbox from access, that would be great too!
 
M

Magius96

Forgot to mention, the current path can be either a network drive or a local
drive.
 
D

Douglas J. Steele

The current path and the location of the database are usually not the same
(it depends on how the application was opened).

To know where the application is located, use

Application.CurrentProject.Path
 

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