Application.CurrentProject.Path shows me the path of the current db, which is what i need, but it shows as the mapped drive letter when waht i really need is the full UNC path - can this be done?
that function won't do it per se, but with a little manipulation you can locate the current UNC. You can strip the mapped drive letter from the returned path using the string manipulation functions, and retrieve the missing host name part of the UNC by using the Evironment functions.
Code:
Environ("ComputerName")
yields the name of the PC that is currently running the application.
Second, you already know that the mapped drive letter and colon will be the first two characters of your returned string, therefore:
Code:
string2 = mid(Application.CurrentProject.Path, 3)
then combine the two strings:
Code:
strUNC = hostName & string2
If your PC name is "myPC" and the path statement returned was "C:\dir1\subdir2\subsubdir3\thisDB.mdb" then strUNC is now "\\myPC\dir1\subdir2\subsubdir3\thisDB.mdb" and VBA will reference the DB just as easily through the UNC as through the mapped drive letter.
This, of course, assumes that nothing too out of the ordinary has been done with network sharing, but for the most part, it will work.