How get path of executing database?

G

Guest

I'd like to get the path of the current database from inside VBA.
Is this possible?
E.g. If my database is \\server1\Access\MyApp.mdb

I'd like to get "\\server\Access\" somehow
 
B

Brendan Reynolds

Here are two ways ...

CurrentProject.Path

Left$(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)) -
1)

The first method requires Access 2000 or later, the second will also work
with earlier versions.
 

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