Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Location
    LA, CA
    Posts
    54

    Question Unanswered: OutputTo Text file help

    Ok my lovelies! I have a strange and unusual question for you... i have a client who needs to create a very weird transmittal file to a 3rd party to do banking transactions. The file is fixed width and 94 characters long. It took me a while, but i came up with a report, which is exported to a .txt file and then later uploaded to the 3rd party. Now here is the strange part. There is a row of space after the file is output to a .txt file. Ordinarily, that is no big deal as the user can just hit DELETE and get rid of it... but alas, the client wants it to output so that the first line of the txt file is the actual data. I had to go from a report as i had a lot of difficulty creating an AutoNumber JUST for this transmission file. (not in any of the tables, but the requirements are that the last column be a sequential record number starting with 1)... ANYHOO... does anyone know how to get the file to export with NO SPACE? (i tried setting the page setup to as small as the margins will allow)... ??? help? Pretty please with sugar on top? Thanks!

  2. #2
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by CompAnalyst View Post
    Ok my lovelies! I have a strange and unusual question for you... i have a client who needs to create a very weird transmittal file to a 3rd party to do banking transactions. The file is fixed width and 94 characters long. It took me a while, but i came up with a report, which is exported to a .txt file and then later uploaded to the 3rd party. Now here is the strange part. There is a row of space after the file is output to a .txt file. Ordinarily, that is no big deal as the user can just hit DELETE and get rid of it... but alas, the client wants it to output so that the first line of the txt file is the actual data. I had to go from a report as i had a lot of difficulty creating an AutoNumber JUST for this transmission file. (not in any of the tables, but the requirements are that the last column be a sequential record number starting with 1)... ANYHOO... does anyone know how to get the file to export with NO SPACE? (i tried setting the page setup to as small as the margins will allow)... ??? help? Pretty please with sugar on top? Thanks!
    Trying to export a report to a text file for this seams like a difficult and time consuming (costly) way yo do this.

    I normally just use a little VBA code to open a recordset and write it out to a file in the desired format. This way you can control everything that is written to the file.


    Here is the basics of writing to a file
    Code:
    Dim FH As Long
    
        FH = FreeFile
        Open "c:\myfilename.txt" For Output As #FH
    
        Print #FH, "string to write to file"
    
        Close FH
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    Nov 2003
    Location
    LA, CA
    Posts
    54
    hmmm i am trying to do what you suggested, but i keep getting the error "Compile Error: Invalid use of property" and it's highlighting the rs in the line "rs = currentdb.openrecordset..."

    Maybe i am really screwing something up here... I have this as a Public Function called "Counter()"... is this wrong?

    Rachel

  4. #4
    Join Date
    Nov 2003
    Location
    LA, CA
    Posts
    54
    Ooops, never mind... i changed that row to say "set rs=..." and it worked!!! now i have to figure out how to get the data AND the counter to print.... (along with the header)... i am sure i will have more questions. do you mind if i contact you directly

Posting Permissions

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