I have a form which is used to import worksheets from a file. Each worksheet gets put into its own temp table and then the data is moved into its appropriate table with an append query. However, I am having an issue with one column in particular. When access brings the worksheet into the temp column, it assigns it a data type of number. This field almost never has data in it, but when it does it is two alpha characters. I need it to be data type 'short text'. I have tried the ALTER TABLE option under the docmd.execute and it is not working.
How do I change the data type of a given field in an ACCESS table?
How do I change the data type of a given field in an ACCESS table?
Code:
514 DoCmd.TransferSpreadsheet acImport, _
acSpreadsheetTypeExcel12, strTBLNAME, strFULLPATH, _
True, "IMPORT_NAME"
On Error Resume Next
515 db.Execute "ALTER TABLE strtblname ALTER COLUMN [SCLIN] text"
On Error GoTo ErrCapture