How to Get Default path name used by Access?

  • Thread starter Thread starter MarkV
  • Start date Start date
M

MarkV

I'm using the DoCmd method below to create an excel file
based upon a query. I currently have the path (strPath)
set to a empty string (strPath="") so that access will use
the default directory set in the Tools/Options/General
tab. I want to use a msgbox later to display the path and
file name. I have the strFileName already.

How can I get the default path name being used by Access?
If operator "A" changes the path on his computer I want to
be able to display that value in the msgbox.

thanks
Mark

copy of DoCmd used:
DoCmd.TransferSpreadsheet acExport,
acSpreadsheetTypeExcel8, "qryDataForJBCost", strPath _
& strFileName & ".xls", False
 
You mean the path where the current DB is located? CurrentDb().Name will
give you the complete path and db name, or (Access 2000 and up)
CurrentProject.Path will give you the path.
 
Back
Top