aziz rasul
Active member
- Local time
- Today, 16:20
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have the following code behind a command button: -
How do I change the commented out lines to delete the last line in "D:\Table1.txt" to remove the carriage return?
db attached.
Private Sub Command0_Click()
Dim rst As DAO.Recordset
Dim x As Integer
Dim intLen As Integer
Set rst = CurrentDb.OpenRecordset("Table2", dbOpenDynaset)
DoCmd.TransferText acExportDelim, "", "Table1", "D:\Table1.txt", False
DoCmd.TransferText acExportDelim, "", "Table2", "D:\Table2.txt", False
Open "D:\Table1.txt" For Append As #1
Open "D:\Table2.txt" For Input As #2
Do While Not rst.EOF
Print #1, rst!FirstName
rst.MoveNext
Loop
Close #1
Close #2
Kill ("D:\Table2.txt")
'Open "D:\Table1.txt" For Binary Access Write As #3
'Put #3, , Replace(EOF(3), vbCrLf, "")
'Put #3, , Replace(EOF(3), Chr(10) & Chr(13), "")
'Close #3
End Sub
How do I change the commented out lines to delete the last line in "D:\Table1.txt" to remove the carriage return?
db attached.