Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    45

    Unanswered: how to display the result of a query in notepad with a specific delimiter

    hallo,
    do you know how to display the result of a query in the notepad with a delimiter, for example semicolon.
    thanks for suggestion

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Export the query to a Text file using
    DoCmd.OutputTo
    OR
    DoCmd.TransferText acExportDelim

    Just have a look to its help

  3. #3
    Join Date
    Feb 2004
    Posts
    45
    what I actually need is the notepad to open and the data to be displayed there. With transfertext method you can write the data to a specified filename. I would like not to save the txt file before the data is written in it. Another question about the transferdata: is it possible to define your own delimiter? thanks

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    To open the NotePad use the Shell Command
    Shell("C:\WINDOWS\NotPad.EXE", 1) '

    You can not send the data to the NotPad directly, you have to store them to a .txt file at first then open it using the NotPad
    Shell("C:\WINDOWS\NotPad.EXE yourFileName.txt", 1)

    To change the Delimiter you have to write your own Procedure using the
    Open yourExportFile For Output As #1

  5. #5
    Join Date
    Feb 2004
    Posts
    45
    thank hammbakka, I think i'm getting closer. Could you specify a bit more how to set a delimiter. I'm using the transfertext method that transfer the values beetween quotes and delimited by new line.

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Arrow

    If you detrimine a specification function name, in which you can choose your Del. then you can write its name in the statement

    DoCmd.TransferText acExportDelim, "yourSpecificationName", yourTableOrQueryName, "C:\yourExportFile.txt"

Posting Permissions

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