I found this code that appends new data into an existing text file.
But I need the format to be Tab Delimited instead of CSV.
Any help would be greatly appreciated. Here is a sample. The first line was in the table. The second was appended.
line 1 PR 08974 0008180 0836783 PIERCE 26 110 8540395 1.00 A JB
line 2 "PR","08974","0008060","0015917","SERNA ","26","110","285792","1"
JB
Function AppendtoDaily()
Dim MyDB As DAO.Database
Dim rstDR_08974 As DAO.Recordset
Dim intFileNum As Integer
intFileNum = FreeFile()
Open "C:\JBTools\DR_08974.txt" For Append As #intFileNum
Set MyDB = CurrentDb()
Set rstDR_08974 = MyDB.OpenRecordset("DR_08974", dbOpenForwardOnly)
With rstDR_08974
Do While Not .EOF
Write #intFileNum, ![AsstType], ![PDC], ![UNIT], ![TECHID], ![LastName], ![DIV], ![PLS], ![PART], ![QTY], ![UPLD_TRUCKBIN], ![OVERRIDETYPE], ![Analyst], ![ByPassreason]
.MoveNext
Loop
End With
Close #intFileNum
rstDR_08974.Close
Set rstDR_08974 = Nothing
End Function
But I need the format to be Tab Delimited instead of CSV.
Any help would be greatly appreciated. Here is a sample. The first line was in the table. The second was appended.
line 1 PR 08974 0008180 0836783 PIERCE 26 110 8540395 1.00 A JB
line 2 "PR","08974","0008060","0015917","SERNA ","26","110","285792","1"
JB
Function AppendtoDaily()
Dim MyDB As DAO.Database
Dim rstDR_08974 As DAO.Recordset
Dim intFileNum As Integer
intFileNum = FreeFile()
Open "C:\JBTools\DR_08974.txt" For Append As #intFileNum
Set MyDB = CurrentDb()
Set rstDR_08974 = MyDB.OpenRecordset("DR_08974", dbOpenForwardOnly)
With rstDR_08974
Do While Not .EOF
Write #intFileNum, ![AsstType], ![PDC], ![UNIT], ![TECHID], ![LastName], ![DIV], ![PLS], ![PART], ![QTY], ![UPLD_TRUCKBIN], ![OVERRIDETYPE], ![Analyst], ![ByPassreason]
.MoveNext
Loop
End With
Close #intFileNum
rstDR_08974.Close
Set rstDR_08974 = Nothing
End Function