Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Reports: Controlling file name when going to pdf (Access 2002 10.4302 SP-2

    I have an application utilizing a simple report who's data set is filtered by a date (the possible dates are fixed and known a year in advance) . The report works just fine. I have a further need to upload multiple versions (different date filters) of this report onto a web site (I create pdf's). There is generally 8-9 reports up on the web at any given time. To eliminate file naming problems I am currently editing the report on the fly and creating a custom report caption for the default pdf file name. Again this works just fine. However, this approach won't work in complied mode. Does anyone know of an alternative way to create a file name based on the report's selection criteria? I don't want the ultimate user of the application to have to try to key enter the correct file name which has bee pre-established by the web-master.

    Thanks much.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Controlling file name when going to pdf (Access 2002 10.4302

    You can set the report caption in code:

    Reports!rptMyReport.Caption = "Report20050717"

    You can also use code to rename the pdf file after it has been created:

    Name "C:ExportMyReport.pdf" As "C:ExportReport20050717.pdf"

  3. #3
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Reports: Controlling file name when going to pdf (Access 2002 10.4302

    Hans,

    I must be missing the obvious, doesn't your code [ Reports!rptMyReport.Caption = "Report20050717"
    ] require the report to be open (acViewDesign), which is what I'm trying to avoid using in order to compile and run as an mde?

    Thanks,
    Marty

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Controlling file name when going to pdf (Access 2002 10.4302

    You can set the caption while the report is open in preview mode, it doesn't have to be open in design mode. Obviously, this won't work if you print the report directly, without previewing it. you'd need to rename the PDF file then after it has been created.

  5. #5
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Reports: Controlling file name when going to pdf (Access 2002 10.4302

    Thank you, that clears it up.

    Marty

Posting Permissions

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