Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Atlanta
    Posts
    568
    Thanks
    7
    Thanked 1 Time in 1 Post

    ASCII Reports (97)

    In Access, it is possible to create a report that has no formatting at all other than line breaks? I want to use the report to generate an ASCII file to import into another problem. It is inconvenient to use a query for this purpose because I need multiple lines for each record.

    Alternatively, if there is a way to insert returns into a query so that one record can generate multiple lines when the query is saved as a TXT file, that too would work.

    Right now, I am using a query that writes each record to a single line and then using a Word macro to clean up the text and insert the necessary returns. That works great for me, and I'm the only one using the database right now, but I want to give it to some others to use and I don't want them to have to run the Word macro.

    Ronny
    Ronny Richardson

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ASCII Reports (97)

    By definition, a record is a single row in a query, which translates to a single line in a file, so what do you mean by multiple lines for each record?

    It sounds like you would be better off doing direct file I/O from a recordset using the Open statement and writing parts of each record directly into a line in the text file.
    Charlotte

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Pennsylvania, USA
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASCII Reports (97)

    If you are intent on doing this with reports, you can do the following:

    1. Create a report with no ReportHeader, PageHeader, GroupHeader, GroupFooter, PageFooter or ReportFooter (i.e. only a Detail section). Map your fields in the detail section so you get multiple rows of data to suit your purposes. Save this report.

    2. There is a toolbar button that you can use to run the report to Word or Excel. You can add an entry to this toolbar button to output to Notepad. First, right-click on the Database toolbar and choose Customize from the shortcut menu. Click on the Commands tab and you'll see all of the available commands that can be added to your menus and toolbars. In the Categories list box, select Tools. Now, locate the Output To Notepad button in the Commands list box and drag it to the desired position on the Database toolbar. Then click Close.

    Now, whenever you want to create your ASCII file, simply click on the report name, then click the dropdown to the right of the OutputTo toolbar button and choose Output To Notepad!

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Atlanta
    Posts
    568
    Thanks
    7
    Thanked 1 Time in 1 Post

    Re: ASCII Reports (97)

    >By definition, a record is a single row in a query, which translates to a single line
    >in a file, so what do you mean by multiple lines for each record?

    I know that a single line in a query always equals a record. What I'm wondering is if it is possible for that line to contain "new line" characters that get treated as a return when that line is written out to a text file. If that is possible, then the query would have one "line" per record that would translate into multiple lines when the query was saved as a text file.

    I accomplish this indirectly now by writing including character strings in the query that a Word macro searches on and replaces with returns. I just want to skip using the macro.

    Ronny
    Ronny Richardson

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Atlanta
    Posts
    568
    Thanks
    7
    Thanked 1 Time in 1 Post

    Re: ASCII Reports (97)

    Sounds good. I'll give it a shot. Thanks.

    Ronny
    Ronny Richardson

Posting Permissions

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