Problem with App.Path

foody

Registered User.
Local time
Yesterday, 17:34
Joined
Sep 21, 2005
Messages
36
I am having problem specifying App.path in VB using Access, here is the line:

DoCmd.TransferDatabase acExport, "Microsoft Access", Path & "MarbleExport.mdb", acTable, "Estimate-Address", "Estimate-Address", False
DoCmd.TransferDatabase acExport, "Microsoft Access", Path & "MarbleExport.mdb", acTable, "Estimate-Order", "Estimate-Order", False
DoCmd.TransferDatabase acExport, "Microsoft Access", Path & "MarbleExport.mdb", acTable, "Estimate-Description", "Estimate-Description", False


I am using Path now because when I tried App.Path it doesn't work and Path right now doesn't work. Does anyone else have any suggestions in telling the thing to find the file MarblExport.mdb where it is located without hard coding it? If I hard code it, it means when I move the file some place else I have to change it everytime and that is really not good at all. Any help would be greatly appreciate it, thanks in advance.
 
App.Path only works in Visual Basic, not VBA [Visual Basic for applications] which is what you are programming in with Access, Excel, Word, Etc.

Searching the forum is a great way to find and discover the answers to your Access programming questions!

Getting the location to the current database using Access 2000/2002/2003...

'returns the database file name
CurrentProject.Name

'returns the database path
CurrentProject.Path

'returns the database path and the file name
CurrentProject.FullName

Getting the location to the current database using Access 97...

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

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

'returns the database path and the file name
CurrentDb.Name

'returns the directory that Access [msaccess.exe] is installed in
(SysCmd(acSysCmdAccessDir))

HTH
 
RE: App.path

Thanks for the post. This helped me today. Thought I used "App.Path" in Access before, but it definitely doesn't work in '03. Cheers!;)
 

Users who are viewing this thread

Back
Top Bottom