Choosing the File Path when Exporting a querie

  • Thread starter Thread starter Chris Gorham
  • Start date Start date
C

Chris Gorham

Hi,

I'm exporting the results of a querie into Excel...it works no problem using
the foillowing code:

DoCmd.TransferSpreadsheet acExport, 8, querie_sel, "D:\Documents and
Settings\cgorham\Desktop\" & tab_sel & " - " & querie_sel & " " & increm &
".xls", True, "ICMS Database"

However it would be nice to give the user the ability to set and store his
own file path so that I don't have to tailor the database for him.

How can I do this...??

I assume that I can save the file path in the registry...and I guess I could
bring up an input box to type in the path, but it would be nicer for the user
to select it rather than type it...

Chris
 
I do allot of the exporting to excel with this app. some times i hard code
it to be saved in C:\Temp\somefile name.

Since you said true to open excel after the down load, i just over write the
file every time. if the user wants a copie of the data i tell them after
excel opens, click file save as and let them deal with it.

if you want to prompt where to be saved, leave the file path blank, access
will prompt them to browse for the file save as.

also, i use the docmd output, its old but works.

this one out puts the query after they browse to where they want it saved
DoCmd.OutputTo acOutputQuery, "qselJobDSORpt", acFormatXLS, , True

this one saves it to a temp file, over writes itself every time they click
down load
DoCmd.OutputTo acOutputQuery, "qselJobDSORpt", acFormatXLS,
"c:\temp\DSOByday.xls", True
 
Back
Top