Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    United Kingdom
    Posts
    56

    Unanswered: Output Report to RTF

    Hey guys,

    I have a btn on a form which runs the code below to output a report to rtf.

    Is there any way of specifying a folder I want the .rtf file saved in? At present it just sticks it in the same folder as the database.

    Also is there any way of using VBA to specify a file name for the .rtf file. I want to use the term "Invoice Request" and the value in the field called [InvoiceRequestNumber].

    Any help would be greatly appreciated - this is the last piece of a large puzzle for a costing and invoicing system I'm designing

    Thanks,

    Rusty


    Code:
    Private Sub btnPrintInvoiceRequest_Click()
    DoCmd.RunCommand acCmdOutputToRTF

    End Sub

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    try:
    DoCmd.OutputTo acOutputReport, "Report Name", acFormatRTF, "desiredpath\name.RTF"

    find more with Access help.. OutputTo method

  3. #3
    Join Date
    Apr 2004
    Location
    United Kingdom
    Posts
    56

    Talking Output Format argument

    Thanks for the help Cyherus. I've used:


    DoCmd.OutputTo acOutputReport, "rptInvoice Request Form_patient events", acFormatRTF, , , ""

    This allows the user to specify where they want to save the file and under what name. However, do you know of a way to set the Output Format argument so that it will save it in the folder "Q:\Paperwork" AND under the file name "invoice" & the value in the [RequestNumber] field of the report?

    I've tried several different things within the code above but it doesn't work

    Thanks,

    Rusty

  4. #4
    Join Date
    Jun 2004
    Posts
    96
    u basically do this:

    DoCmd.OutputTo acOutputReport, "tablename", acFormatRTF, "Q:\Paperwork\invoice" & requestnumber & ".rtf", False

    you can, but first, request number comes from where? only found in the report?? or is it some number generated by u??

    Cyherus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •