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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Path 2

Status
Not open for further replies.

Tom123456

Programmer
Apr 2, 2003
70
SE
Is that a function that returns the path to the dirctory that I run my access application in?



- Tom
 
Try this:
Dim x As String
x = CurrentDb.Name

Variable x will now have the path of the current database. You see the .Name property of any database has the current path location of that database.

Bob Scriver
 
...or, ADO version:

x = CurrentProject.FullName

Then you can search for the last "\" in the string:

For i = Len(x) to 1 Step - 1
If Mid(x,i,1) = "\" Then
JutPath = Left(x, i)
Exit For
End If
Next


Good luck


[pipe]
Daniel Vlas
Systems Consultant

 
And if I want to remove the database name in the path?

- Tom
 
I have tried that, it gives an empty string.

- Tom
 
ooupps sorry, my fault. Thanks it works real great!!

- Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top