Hello folks,
I have problem, which I can't resolve. I use a the transferspreadsheet command in a form's module to import a certain portion of an excel spreadsheet into a table -- nothing spectacular:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "AC_Import", Me.Filename, False, "Firstsheet!" & "A" & Trim(Val(Me.RowFrom)) & ":X" & Trim(Val(Me.RowTo))
The whole thing works fine, albeit for one exception. If the text to be imported from the spreadsheet starts with an asterix (*), like for example: *25 the command doesn't go through and produces a Type Conversion error, and the field content is not imported.
The table AC_Import is a table, consisting of only text fields, set to maximum length. Actually, i used to create a new table during import, but that created many more of the same problems, as the import procedure would try to determine the kind of data contained in a column by the first data row. So if it read - say 25 - in the first row for a certain field, it would always conclude, that this must be an integer field, and any subsequent entry with - say xxx - in that same column would then produce a type conversion error. So by setting everything to a text field, before I hoped, it would solve the issue... and it did, but not for the asterixes in first position.
Any idea?
Many thanks
I have problem, which I can't resolve. I use a the transferspreadsheet command in a form's module to import a certain portion of an excel spreadsheet into a table -- nothing spectacular:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "AC_Import", Me.Filename, False, "Firstsheet!" & "A" & Trim(Val(Me.RowFrom)) & ":X" & Trim(Val(Me.RowTo))
The whole thing works fine, albeit for one exception. If the text to be imported from the spreadsheet starts with an asterix (*), like for example: *25 the command doesn't go through and produces a Type Conversion error, and the field content is not imported.
The table AC_Import is a table, consisting of only text fields, set to maximum length. Actually, i used to create a new table during import, but that created many more of the same problems, as the import procedure would try to determine the kind of data contained in a column by the first data row. So if it read - say 25 - in the first row for a certain field, it would always conclude, that this must be an integer field, and any subsequent entry with - say xxx - in that same column would then produce a type conversion error. So by setting everything to a text field, before I hoped, it would solve the issue... and it did, but not for the asterixes in first position.
Any idea?
Many thanks