Isaac
Lifelong Learner
- Local time
- Today, 08:08
- Joined
- Mar 14, 2017
- Messages
- 10,971
Last couple years of minimal Access use must have me really rusty because I am doing something pretty basic and still confused.
I have a table with a column where the column datatype is Short Text with length 255 and format @
Using TransferSpreadsheet:
Everything works great, the spreadsheet headers are all perfectly matched to the identical table column names.
Except a few records end up in the table: a1:fc59_ImportErrors
I've identified the anomaly on the spreadsheet ... in the problem column, 90% of the records are numbers, like 2.5 or 7. Then occasionally on the 'problem' records, the value is two consecutive dashes, like --
So sure, I get why Access thought they were numbers and then got surprised, but why does this matter? The destination column is short text!
Please don't tell me I have to resort to row-by-row recordset adds or something...I already tested it in my scenario, terribly slow.
The only other hacky thing I can think of is to add more code to loop through any Import Errors table and try to figure out how to update them manually, but hopefully there is some straightforward solution that I probably knew once upon a time but cannot remember now.
Is the only way out of this to link to the Excel file and do an append query?
I have a table with a column where the column datatype is Short Text with length 255 and format @
Using TransferSpreadsheet:
Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "SnapshotTable_TempImport", strWorkbookPath_new, True, "a1:fc" & lastrow
Everything works great, the spreadsheet headers are all perfectly matched to the identical table column names.
Except a few records end up in the table: a1:fc59_ImportErrors
I've identified the anomaly on the spreadsheet ... in the problem column, 90% of the records are numbers, like 2.5 or 7. Then occasionally on the 'problem' records, the value is two consecutive dashes, like --
So sure, I get why Access thought they were numbers and then got surprised, but why does this matter? The destination column is short text!
Please don't tell me I have to resort to row-by-row recordset adds or something...I already tested it in my scenario, terribly slow.
The only other hacky thing I can think of is to add more code to loop through any Import Errors table and try to figure out how to update them manually, but hopefully there is some straightforward solution that I probably knew once upon a time but cannot remember now.
Is the only way out of this to link to the Excel file and do an append query?