Output to a named folder

Nelmo

Registered User.
Local time
Today, 22:37
Joined
Mar 13, 2001
Messages
17
When I run the following procedure the report always outputs to the Windows desktop.

Dim stDocName As String
Dim StFileName As String

stDocName = "rptSiteOrders"
StFileName = Forms!frmViewOrders!cmbSites & "." & "RTF"

DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, StFileName

How can I force the output to save to a named folder on the desktop?
How can I ceck if the folder exists (giving the user the option to create it would be even better)?
How do I check whether the file already exists in the folder and give the option to overwrite?

Thanks for your time
NELMO
 
The OutputFile should contain to full path and file name.
 
I recently had a similar issue with Folders
Hope this helps

The DIR function searches for a folder
Then MKDIR creates the folder if it is not found.

'Find the Folder if it exists
strFolderName = Dir(strPath & strFolder, vbDirectory)

'If Folder not found then Make Directory
If strFolderName = "" Then
MkDir (strPath & strFolder)
 

Users who are viewing this thread

Back
Top Bottom