import text file missing first record

Directlinq

Registered User.
Local time
Yesterday, 21:36
Joined
Sep 13, 2009
Messages
67
Hi could somebody please tell me why when i use the code below it always fails to import the first record of each file.

Code:
DoCmd.TransferText acExportDelim, "BackupFolders", "BackupFolders", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\BackupFolders.txt", False, ""
DoCmd.TransferText acExportDelim, "CompanyNames", "CompanyNames", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\CompanyNames.txt", False, ""
DoCmd.TransferText acExportDelim, "Contacts", "Contacts", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\Contacts.txt", False, ""
DoCmd.TransferText acExportDelim, "ExpensesItemstbl", "ExpensesItemstbl", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\ExpensesItemstbl.txt", False, ""
DoCmd.TransferText acExportDelim, "Endtaxyear", "Endtaxyear", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\Endtaxyear.txt", False, ""
DoCmd.TransferText acExportDelim, "ExpensesNoVATItemstbl", "ExpensesNoVATItemstbl", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\ExpensesNoVATItemstbl.txt", False, ""
DoCmd.TransferText acExportDelim, "HeadedPaper", "HeadedPaper", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\HeadedPaper.txt", False, ""
DoCmd.TransferText acExportDelim, "Invoices", "Invoices", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\Invoices.txt", False, ""
DoCmd.TransferText acExportDelim, "MonthlyExpenses", "MonthlyExpenses", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\MonthlyExpenses.txt", False, ""
DoCmd.TransferText acExportDelim, "MonthlyExpensesNoVat", "MonthlyExpensesNoVat", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\MonthlyExpensesNoVat.txt", False, ""
DoCmd.TransferText acExportDelim, "Months", "Months", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\Months.txt", False, ""
DoCmd.TransferText acExportDelim, "TaxYearTotals", "TaxYearTotals", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\TaxYearTotals.txt", False, ""

If i import it manually it all comes across properly but using this code skips the first record of each file. When i import it manually i use the same settings as in the the specification name
Many Thanks
 
First of all, after each of the FALSE parts at the end REMOVE the comma and double quotes. So the line should look like this:
Code:
DoCmd.TransferText acExportDelim, "BackupFolders", "BackupFolders", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & TodaysDate & "\BackupFolders.txt", False
 
Ok I have done as you have said.
The code in the first post works as it exports all the records.
Its when i call the records back in that it misses the first record from each file.
Here is my import code
Code:
DoCmd.TransferText acImportDelim, "CompanyNames", "CompanyNames", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\CompanyNames.txt", True
DoCmd.TransferText acImportDelim, "Contacts", "Contacts", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\Contacts.txt", True
DoCmd.TransferText acImportDelim, "ExpensesItemstbl", "ExpensesItemstbl", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\ExpensesItemstbl.txt", True
DoCmd.TransferText acImportDelim, "Endtaxyear", "Endtaxyear", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\Endtaxyear.txt", True
DoCmd.TransferText acImportDelim, "ExpensesNoVATItemstbl", "ExpensesNoVATItemstbl", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\ExpensesNoVATItemstbl.txt", True
DoCmd.TransferText acImportDelim, "HeadedPaper", "HeadedPaper", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\HeadedPaper.txt", True
DoCmd.TransferText acImportDelim, "Invoices", "Invoices", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\Invoices.txt", True
DoCmd.TransferText acImportDelim, "MonthlyExpenses", "MonthlyExpenses", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\MonthlyExpenses.txt", True
DoCmd.TransferText acImportDelim, "MonthlyExpensesNoVat", "MonthlyExpensesNoVat", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\MonthlyExpensesNoVat.txt", True
DoCmd.TransferText acImportDelim, "Months", "Months", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\Months.txt", True
DoCmd.TransferText acImportDelim, "TaxYearTotals", "TaxYearTotals", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\TaxYearTotals.txt", True
DoCmd.TransferText acImportDelim, "BackupFolders", "BackupFolders", Environ("USERPROFILE") & "\Desktop\VatBooks\DataBackup\" & FolderBackupName & "\BackupFolders.txt", True

Many Thanks
 
Sorry, Just figured it out.
The true at the end needed to be changed to false.

Thanks you for you help
 
Sorry, Just figured it out.
The true at the end needed to be changed to false.
Which has me confused because you had it as FALSE in your first code post and I just said to remove the

, ""

from it, not change False to True :confused::D
 

Users who are viewing this thread

Back
Top Bottom