DoCmd.OutputTo: Store path location selected by user to a string (1 Viewer)

kapaw

Registered User.
Local time
Today, 07:49
Joined
Mar 30, 2011
Messages
30
I am using this code
DoCmd.OutputTo acOutputReport, "rptFilter", "Excel97-Excel2003Workbook(*.xls)", strFilename, True, "", , acExportQualityScreen
with the OutputFile set to "" so the user can select the directory on where they want to store the exported template. My issue is I'm trying to figure out if I could get the file path and the file name and store it on a string so I could use it for something else.
 

Cronk

Registered User.
Local time
Tomorrow, 00:49
Joined
Jul 4, 2013
Messages
2,772
At the simplest level you could prompt the user to enter the details

Code:
strFileName = InputBox("What is the output file")
 

kapaw

Registered User.
Local time
Today, 07:49
Joined
Mar 30, 2011
Messages
30
What about the directory on which the user will store it? I want to be able to store that in a string too including the filename
 

Cronk

Registered User.
Local time
Tomorrow, 00:49
Joined
Jul 4, 2013
Messages
2,772
strFileName = InputBox("What is the output file", "Enter path and file name", "C:\your directory\your file name.xlsx")
 

Users who are viewing this thread

Top Bottom