Naming Convention for Text Export

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grumpydadtl
    New Member
    • Aug 2008
    • 4

    Naming Convention for Text Export

    How can I name a text export using periods in the file name:

    ABC.D31.HBCVF.t xt.rbd31

    as opposed to something like "Export.txt "?

    Each time I try, Access changes the text export file name to:

    ABC#D31#HBCVF#t xt#rbd31

    I am using a fixed width text export.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    I don't think that Access will allow you to do that directly, but ironically, you can Rename the Fixed Width Text File immediately after creating it, allowing Periods, as in:
    Code:
    DoCmd.TransferText acExportFixed, "<My Specs>", "Employees", "C:\Test\ABC.D31.HBCVF.txt", True
    Name "C:\Test\ABC#D31#HBCVF.txt" As "C:\Test\ABC.D31.HBCVF.txt"
    BTW, it is a good idea to leave the .txt Extension at the end of the File.

    Comment

    • grumpydadtl
      New Member
      • Aug 2008
      • 4

      #3
      That worked perfectly! The file name (and extension) is for an import into a mainframe program. Since I have to overwrite this same file name on each export, is there a command to delete the text file at the start of the routine?

      Currently the program halts when it realizes there is already a file named the same as I am trying to change the export file to.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by grumpydadtl
        That worked perfectly! The file name (and extension) is for an import into a mainframe program. Since I have to overwrite this same file name on each export, is there a command to delete the text file at the start of the routine?

        Currently the program halts when it realizes there is already a file named the same as I am trying to change the export file to.
        Try:
        Code:
        Kill "C:\Test\ABC#D31#HBCVF.txt"

        Comment

        Working...