Save Rename (1 Viewer)

kev

Registered User.
Local time
Today, 12:00
Joined
Dec 30, 2000
Messages
13
I am looking to save a report to a hard drive
which isnt a problem but I need to be able to
have the file name either taken from the record or have the operator to assign but I dont want them to change path

Thanks in Advance
Kev
 

Chris RR

Registered User.
Local time
Today, 06:00
Joined
Mar 2, 2000
Messages
354
Try this:
Dim strFilename as string
Dim strPath as string

' we will assume you are picking up the file name from a form
strFilename = [Forms]![fMyForm]![My_File_Name] 'or me.My_File_Name, if we are in the form code

strPath = "C:\Somewhere\" & strFileName & ".rtf"
DoCmd.OutputTo acOutputReport, rMyWonderfulReport, "RichTextFormat(*.rtf)", strPath, False
 

Users who are viewing this thread

Top Bottom