Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exporting by record (Access 2003)

    Is it possible to export a report and have a seperate report be produced for each record? So if there are 10 records in the report, 10 seperate reports would be created??

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

    Re: Exporting by record (Access 2003)

    The database attached to <post#=376,236>post 376,236</post: > shows how you can export a report for each individual record. You can view the code in the Visual Basic Editor.

    Note: the reports are exported to snapshot format. You can easily change it to RTF, text or another format.

  3. #3
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting by record (Access 2003)

    Thanks Hans.

    I brought it over and tried to adapt the VB to my Database but so far no luck. I changed the query name and the report name. From what I see the DIM statements, the ErrHandler and ExitHandler should be the same. Is there a line I am overlooking?

    I can see how to change it to an .rtf, but have you ever tried to export it to a .pdf?

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

    Re: Exporting by record (Access 2003)

    If you'd like us to have a look at your database, you can create a stripped down copy and post it. See <post#=401925>post 401925</post#> for instructions.

    Access itself has no built-in support for exporting to PDF. Instead, you print to a PDF "printer". You need to have installed software to print to PDF for this.

  5. #5
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting by record (Access 2003)

    Hans, I do have the acrobat distiller installed on my computer. I know i can save a word doc as a .pdf if I go to print and select acrobat distiller. I have this do I need to just edit the code to say .pdf??

    I will strip the DB down and post it shortly. Thanks

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

    Re: Exporting by record (Access 2003)

    You can set the printer in code, look up the Printer property in the online help. So you can set it to the Distiller "printer". The first part of the thread starting at <post#=322,048>post 322,048</post: > may be useful.

  7. #7
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting by record (Access 2003)

    Printing question, another idea i came up with, is it possible to print every record of a report seperately??

    Oh by the way i figured out the problem i had with the export. I debugged and realized the "gstrSection = rst!Section" line was the problem. I overlooked the fact that section was a field in the table.

    Thanks,
    Jordan

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

    Re: Exporting by record (Access 2003)

    To print individual reports, you could redesign the report to start a new page for each record, or you could use the same method as in the post I referred to, but instead of using DoCmd.OutputTo, use DoCmd.OpenReport - if you only specify the report name, it will be printed directly.

  9. #9
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting by record (Access 2003)

    Thanks Han, I used DoCmd.OpenReport "ReportTitle", acViewNormal and it worked great!
    thanks

  10. #10
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting by record (Access 2003)

    Hans I was trying to play with the following code so I could print each record individually through adobe distiller...

    i = i + 1
    oldTestCaseNumber = TestCaseModule.TestCaseNumber
    strFilename = "C:TempTestCase_" & i & ".pdf"
    DoCmd.OpenReport "SA_CaseReport", acViewNormal
    rst.MoveNext

    Unfortunately every time I run the code it pops up the "save PDF as" box and i need to save each report individually.

    Is there something wrong with my loop?

    Thanks,
    Jordan

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

    Re: Exporting by record (Access 2003)

    See if <post#=322,094>post 322,094</post: > helps. I don't have Acrobat Distiller myself, so I cannot offer specific help.

Posting Permissions

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