K
krista.m.chase
I am building a text file export and I want the file to export with
the following format:
ID + MM + DD + Sequence Character (example 12341107A.txt for ID 1234
on 11/7/2007)
What I want to occur is for the first export the sequence character is
"A", but for any additional exports on that same day the character
needs to be a "B" (on the second export) or a "C" (on the third
export) and so on. Typically the export will only occur once unless
there are issues but I need to be able to reference any existing
exports and make the next file in sequence.
Below is my current code and it is repeating the same file name with a
"B" as the sequence character and deleting the existing file. Any help
is greatly appreciated!
Dim counter As Integer
For counter = 65 To 90 Step 1
retval = Dir$("X:\3500" & Format(Date, "mmdd") & Chr(counter) &
".txt")
If retval = "" Then Exit For
Next counter
counter = counter + 1
DoCmd.TransferText acExportFixed, "3500 Import Specification",
"FileFormatExport", "X:\3500" & Format(Date, "mmdd") & Chr(counter) &
".txt", False, ""
the following format:
ID + MM + DD + Sequence Character (example 12341107A.txt for ID 1234
on 11/7/2007)
What I want to occur is for the first export the sequence character is
"A", but for any additional exports on that same day the character
needs to be a "B" (on the second export) or a "C" (on the third
export) and so on. Typically the export will only occur once unless
there are issues but I need to be able to reference any existing
exports and make the next file in sequence.
Below is my current code and it is repeating the same file name with a
"B" as the sequence character and deleting the existing file. Any help
is greatly appreciated!
Dim counter As Integer
For counter = 65 To 90 Step 1
retval = Dir$("X:\3500" & Format(Date, "mmdd") & Chr(counter) &
".txt")
If retval = "" Then Exit For
Next counter
counter = counter + 1
DoCmd.TransferText acExportFixed, "3500 Import Specification",
"FileFormatExport", "X:\3500" & Format(Date, "mmdd") & Chr(counter) &
".txt", False, ""