I'm having difficulty with DoCmd.TransferT ext for a small comma-delimited file.
In one VBA procedure I Select a person's record from the People table, scramble the text fields for security, write it to a temporary delimited file and then email that file as an attachment to another user with their own copy of the database (same FE, different data in the BE but they need to add a copy of this particular record).
The recipient saves the file and passes it's location to a VBA procedure which executes CREATE TABLE to make an empty table with the same structure as the original, then uses TransferText to import the data to that table, unscrambles the text fields then appends it to the his People table.
At least that's the idea. In practice the import TransferText gets Error 3421, Data Type Conversion Error. Since the receiving table has the same structure as the sending table (I have checked this!) the only explanation I can think of is that the transfer file sometimes has null fields. Does anyone know if TransferText has problems handling empty fields?
The CREATE TABLE statement doesn't have any NOT NULL clauses, but it does have a lot of fields - 46 of them, including a mix of CHAR, INTEGER, BYTE, DATETIME formats, which is making it very hard for me to locate the problem. But surely TransferText should be able to import any files which it has exported?
In one VBA procedure I Select a person's record from the People table, scramble the text fields for security, write it to a temporary delimited file and then email that file as an attachment to another user with their own copy of the database (same FE, different data in the BE but they need to add a copy of this particular record).
The recipient saves the file and passes it's location to a VBA procedure which executes CREATE TABLE to make an empty table with the same structure as the original, then uses TransferText to import the data to that table, unscrambles the text fields then appends it to the his People table.
At least that's the idea. In practice the import TransferText gets Error 3421, Data Type Conversion Error. Since the receiving table has the same structure as the sending table (I have checked this!) the only explanation I can think of is that the transfer file sometimes has null fields. Does anyone know if TransferText has problems handling empty fields?
The CREATE TABLE statement doesn't have any NOT NULL clauses, but it does have a lot of fields - 46 of them, including a mix of CHAR, INTEGER, BYTE, DATETIME formats, which is making it very hard for me to locate the problem. But surely TransferText should be able to import any files which it has exported?
Comment