application path

D

Dave

Hi,
I have written some error handling code that wites details of the error to a
log file.

I want to be able to use this in a numbe of my projects now.
So instead of hardcoding the path of the log in the code id like to have it
be dynamic.

ie

apppath/appname_errorlog.txt

I cant find the variable that hold the applications path.
Any suggestions appreciated

Thanks

Dave
 
D

Dave

Thanks for reading but i've found i can use this

varFileName = Left(Application.CurrentDb.Name,
Len(Application.CurrentDb.Name) - 4) & "_ErrorLog.txt"

and it seems to work ok for me
 
B

Brendan Reynolds \(MVP\)

In recent versions of Access, you can use CurrentProject.Path,
CurrentProject.Name, and CurrentProject.FullName. But your method is fine
too, and has the advantage that it will also work with earlier versions of
Access.
 

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