Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Export to txt (97 --->)

    I have a query that I wish to download as a txt file but I want it in a specific format.
    I would like the output to be comma seperated looking like the following:

    Field1,Field2
    1234, Roger
    4567,Fred
    5432, Rachael

    ......etc

    All the standard VBA and macro methods delimit it with pipes and minus signs.

    My preferred method is to have a command button on a reporting Form. Any ideas on how I can keep create this format?
    Jerry

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

    Re: Export to txt (97 --->)

    Use File | Export to export the query to a text file. Set the delimiter etc. the way you want it. Instead of clicking Finish at the end, click Advanced...
    Click Save As... to save the settings as an export specification.

    In the code behind the command button, you can specify the export specification to be used. The code looks like this:

    DoCmd.TransferText TransferType:=acExportDelim, SpecificationName:="MyExportSpecification", _
    TableName:="qryTest", FileName:="F:ExportTest.txt", HasFieldNames:=True

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Export to txt (97 --->)

    Ahah, very clever.

    Let me clarify though. I am using Access XP and will be converting the database to 97 for another user. I do not have those options in the XP file menu..... or am I doing something wrong?
    Jerry

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Export to txt (97 --->)

    Hans

    Cancel my last, I did a right hand mouse click on the query and got the Export menu and I carried on with the Wizard from there.... perfect <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

Posting Permissions

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