Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export rpt to location 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
You can use OutputTo method to export a report.

Code:
DoCmd.OutputTo acOutputReport, "RptOprichtingsjaar", acFormatRTF

But it does not said were to output. You need to choise a location along the dialog screen. I like to use a fixed or variable location defined in my code. how to ? eg. if the name of the report is AL then place it in the map D:\AL. Should I use another method ?
 
MSAccessHelp said:
expression.OutputTo(ObjectType, ObjectName, OutputFormat, OutputFile, AutoStart, TemplateFile, Encoding)

look @ the 4th pramaeter


 
Put the cursor inside the OutputTo word in your code and press the F1 key.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Code:
DoCmd.OutputTo acOutputReport, "Rpt_01_FechaConstitution", acFormatRTF, strMap, True"

ok, trying this he start the export action but said, "can't save the file" and the export is not completed ?
 
What's in the variable "strMap"?

That is the path/filename for the output.
Notes:
- Folders must exist
- You must have permission to create new files and write to the folder
- If an existing file of that name is there, it must not be read only (either file attributes or filesystem permissions).

John
 
correct John "What's in the variable "strMap",

strMap was my variable name of my directory and not a name for the file. He couldn't save a file of a map. Now I put a name for the file and it works.

Code:
DoCmd.OutputTo acOutputReport, "Rpt_01_FechaConstitution", acFormatRTF, strMap & "Rpt_01_FechaConstitution.doc", True"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top