Apr 29, 2003 #1 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
Apr 29, 2003 #2 scriverb Programmer May 17, 2002 4,485 US 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 Upvote 0 Downvote
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
Apr 29, 2003 2 #3 danvlas Programmer Jul 30, 2002 2,446 RO ...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 Daniel Vlas Systems Consultant http://www.geocities.com/danvlas/AutoMail.html Upvote 0 Downvote
...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 Daniel Vlas Systems Consultant http://www.geocities.com/danvlas/AutoMail.html
Apr 30, 2003 Thread starter #4 Tom123456 Programmer Apr 2, 2003 70 SE And if I want to remove the database name in the path? - Tom Upvote 0 Downvote
Apr 30, 2003 #5 danvlas Programmer Jul 30, 2002 2,446 RO Use the JustPath variable as above Daniel Vlas Systems Consultant http://www.geocities.com/danvlas/AutoMail.html Upvote 0 Downvote
Use the JustPath variable as above Daniel Vlas Systems Consultant http://www.geocities.com/danvlas/AutoMail.html
Apr 30, 2003 Thread starter #6 Tom123456 Programmer Apr 2, 2003 70 SE I have tried that, it gives an empty string. - Tom Upvote 0 Downvote
Apr 30, 2003 Thread starter #7 Tom123456 Programmer Apr 2, 2003 70 SE ooupps sorry, my fault. Thanks it works real great!! - Tom Upvote 0 Downvote