Get Db name only

T

TK

I am wondering if there is a way to send the db name only to a function? I
have tried sending CurrentDb.Name but that sends the entire path - I want
only the file name itself- e.g. MyDb.mdb
Is there a better, easier, faster way than looping through the path name
until you have eliminated all of the "\" marks?
Thanks in advance.
TK
 
D

Douglas J. Steele

And, for the sake of completeness, if you're using Access 97 or older (for
which the CurrentProject.Name will not work), you can use
Dir(CurrentDb.Name) to return only the file name.
 

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