Getting the correct directory

C

Cummings

Hi, all.

I have a small group of users for a particular database -- probably about
half a dozen spread around the country. Instead of trying to get ACCESS to
work over a network, our powers that be decided that the best way for folks
to access and work with the db is to post it in a shared directory and have
users download it to their computer and upload when they are finished.

I know. I shake my head too. Given our small group, we really haven't had
an issue with folks overwriting.

But, one of the forms has pictures of the appropriate technology on it. I
finally had success at getting them to appear (thanks to all who posted their
solutions), but every solution I saw required you to hard-code the directory
either in the vB code or in the field.

I tried the CurDir() function, but it just returned "C:\(path)\My
Documents", even though the db was opened from its directory in Explorer.

Is there a way to determine the directory that the db (and subfolders) are
in without having folks navigate their way to it to set the directory?

I appreciate it.

Thanks.

Jim
 
K

Ken Sheridan

Jim:

The following expression will return the path to the folder in which the
current database is located:

Left(CurrentDb.Name,InstrRev(CurrentDb.Name,"\")-1)

Ken Sheridan
Stafford, England
 
D

Dirk Goldgar

Cummings said:
Is there a way to determine the directory that the db (and subfolders) are
in without having folks navigate their way to it to set the directory?


In Access 2000 and later, CurrentProject.Path returns the folder containing
the database.
 
C

Cummings

Ken --

thank you.

Jim
--
JP Cummings


Ken Sheridan said:
Jim:

The following expression will return the path to the folder in which the
current database is located:

Left(CurrentDb.Name,InstrRev(CurrentDb.Name,"\")-1)

Ken Sheridan
Stafford, England
 

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