Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Current Directory/Path?

Status
Not open for further replies.

DJKAOS

Technical User
Jun 30, 2000
101
US
In Access 97 how do I get the current directory/path?

I tried
Dim MyPath
MyPath = CurDir

I also tried
Dim MyPath
MyPath = CurDir("C:") (I think)

but it says library not found for CurDir... any Ideas?

Thanks
 
Not sure what you mean by "current directory", but if you mean the directory the database is in then:

Function GetDBLocation() As String
Dim db As Database
Set db = CurrentDb
GetDBLocation = left(db.Name, Len(db.Name) - Len(Dir(db.Name)))
Set db = Nothing
End Function

will do the trick.

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top