Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Posts
    5

    Question Unanswered: problems formatting my text file generated from using OutputTo method


    I'm having trouble in Access 2000 formatting the text file generated from this code:

    Private Sub Form_Dirty(Cancel As Integer)
    DoCmd.OutputTo acOutputForm, "frmTest", acFormatTXT, "test.txt"
    End Sub


    I need the text file to be comma delimited WITHOUT the field names as the first row. I need only the data in the recordset.
    Please help! Every time it exports I get the field names as the first row and weird borders around each piece of data. I only want commas between the fields and if there are null values I need to see "" instead of " ".
    Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    Althea,


    Your problem is very similar to one i had with importation from a text file, i wanted to add data to a table, from a text file and just give me the error "Field F1 doesn't exist....", or something with field F1. Well the problem was resolved, because i do not set the format of importation, for using it in code. Try to see that question in Knowledge Base, i think that might be helpfull.

    Look For: "Field 'F1' Doesn't Exist in Destination Table" Error Message (Q142186)

  3. #3
    Join Date
    Apr 2002
    Posts
    5

    Thanks! How can I get "" instead of " " in text file?

    Any ideas to help me get "" for every null value INSTEAD of " " for null values???

  4. #4
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    Althea,


    I think you can't. Note when you use comma delimited, you have for example:
    Table_XPTO

    field_name: Althea
    field_date: 10/10/2002
    field_comments: abcdefg
    field_other_comments: NULL
    field_hour: 15:30
    TXT FILE:

    "Althea", 10/10/2002, "abcdefg", " ", 15:30

    and i think you can not change how the data is exported inside, because if you use instead of comma, delimited by ";" you get:

    "Althea"; 10/10/2002; "abcdefg"; ; 15:30

    The " " desapear.

    Or you can set text qualifier to none and you get:

    Althea, 10/10/2002, abcdefg, , 15:30
    Last edited by Miguel; 04-21-02 at 17:03.

Posting Permissions

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