Access home directory

Arrowx7

Registered User.
Local time
Today, 09:05
Joined
Feb 1, 2005
Messages
19
Hello,
I have an microsoft access application, and in the VBA code I am putting a file in a directory. I know how to do that, but I was wondering how I can find the directory the access file is in. I want to be able to put that file in the same directory as the access file itself. The default directory for access is mydocuments, but is there a way to find which directory the parent microsoft access file is at (one containing the VBA code)?

Thanks in advance
 
CurrentProject.FullName

Access 02
 
For Access 97...
'returns the database path and the file name
CurrentDb.Name

'returns the database file name
Dir(CurrentDb.Name)

'returns the database path
Left(CurrentDb.Name,Len(CurrentDb.Name)-Len(Dir(CurrentDb.Name)))

For Access 2000/2002/2003...
'returns the database file name
CurrentProject.Name

'returns the database path
CurrentProject.Path

'returns the database path and file name
CurrentProject.FullName
 

Users who are viewing this thread

Back
Top Bottom