none
Exported records repeat in .RTF file RRS feed

  • Question

  • In my Access 2010 app, I get wierd results results when exporting records to .rtf (and other formats as well.)  The end-goal of my app is to export selected records to an .rtf file, so the user can cut/paste them into a Word doc.  The problem is that exported records are repeated in the output file.  Here's a high-level explanation of the functionality...

    I have a search form.  A sample search sends 63 resulting records in a separate popup form.  The user can select via checkboxes in each returned record on the popup form which records to send to a report.  The search results form has a "Open Report" button that they can click to create the report containing the selected records.  The resulting report has a Export button which exports/prompts to save an .rtf file.  Up to then, the 63 records look fine... I can scroll through all 63 distinct records.

    The problem is that in the export file, records #1, #2, and #3 look fine, but then #3 repeats, i.e., exported records #4 through #63 are replaced by #3.

    By the way, I get same issue -- repeated records -- when exporting to an .html file.

    Lastly, in case it matters, the report records are composed of concatenated labels and fields, something like...

    ="label1: " & [field1] & "-" & [field2] & "<p><p>More label: " & [field3] & IIf([Forms]![frmSearch].[field4] And [field5]>"","<p><p>...        etc., etc.

    However, I don't think the composition of the exported records is the problem because as I said, the first few are exported to the .rtf file fine before the 3rd one starts to repeat.

    Do you have any ideas what could be happening here?  Thanks!


    • Edited by District9 Wednesday, September 2, 2015 6:47 PM
    Wednesday, September 2, 2015 6:45 PM

Answers

  • Hi,

    Thanks for the detail information for this issue.

    I am still not able to reproduce this issue. Here are the steps for testing:
    1. Creating an report

    2. Add an button on the report with code below to export the report:

    DoCmd.OutputTo acOutputReport, "Book1", acFormatRTF, , True

    3. Open the report and filter the report data via the controls on the report, then click the button to export the report

    4. the rtf data exported is correct.

    >> I can't share the database as the data is in SQL. <<

    I suggest that you copy the database and remove the unnessary object and create an demo table in Access and share this dabase to help us to narrow down this issue.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 11, 2015 5:17 AM
    Moderator

All replies

  • I do not follow what you are doing but it appears that your IIF statement is in error --

     IIf([Forms]![frmSearch].[field4] And [field5]>"","<p><p>...  

    I think it should be like this --

     IIf([Forms]![frmSearch].[field4] >"" And [Forms]![frmSearch].[field5] >"","<p><p>...  


    Build a little, test a little

    Wednesday, September 2, 2015 8:29 PM
  • By the way, I get same issue -- repeated records -- when exporting to an .html file.


    Have you tried exporting to Word?

    Build a little, test a little

    Wednesday, September 2, 2015 9:26 PM
  • When I click the "Export Report" button, a dialog comes up prompting for the output format.  Word (.doc, .docx) is not an option.  .rtf is closest to Word.
    Wednesday, September 2, 2015 9:31 PM
  • My 2007 shows Word icon but defaults to .rtf that I can edit to .doc so it creates a Word file.

    Build a little, test a little

    Wednesday, September 2, 2015 9:43 PM
  • Hi,

    I am trying to reprodcuet this issue via using the build-in export feature, however failed.

    Would you mind sharing with us the detail code for the Export button? Also a sample demo is helpful for us to narrow down this issue. You can upload the database via OneDrive. Please remove the sesitive information before you uploading.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, September 10, 2015 6:40 AM
    Moderator
  • Thanks for monitoring this thread.  I can't share the database as the data is in SQL.  But I can share some images of the database objects so at least you follow what the issue is.  The files in the shared folder are numbered consecutively.  Have a look and see if you have any ideas.

    https://onedrive.live.com/redir?resid=A322C24FF0B47E27!37799&authkey=!AN7IuddQjLbbOa4&ithint=folder%2cjpg

    Thursday, September 10, 2015 10:28 PM
  • Hi,

    Thanks for the detail information for this issue.

    I am still not able to reproduce this issue. Here are the steps for testing:
    1. Creating an report

    2. Add an button on the report with code below to export the report:

    DoCmd.OutputTo acOutputReport, "Book1", acFormatRTF, , True

    3. Open the report and filter the report data via the controls on the report, then click the button to export the report

    4. the rtf data exported is correct.

    >> I can't share the database as the data is in SQL. <<

    I suggest that you copy the database and remove the unnessary object and create an demo table in Access and share this dabase to help us to narrow down this issue.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 11, 2015 5:17 AM
    Moderator