I am writing a VB5 application which imports an Excel 97 worksheets into an Access 97 database.
The code works fine except for one field on one worksheet. The first hundred or so values for this field is Text, thereafter it is numeric. After running the VB application, the imported table correctly contains the Text values for the 100 records but then displays "#Num!" instead of the numeric values (the field data type is defined as Text, by the way).
If I open the Access database and manually import the worksheet into a new table, it works fine.
The code I am using to import the data follows:
Dim MyTdf as TableDef, Table as String
Table = "B8 Results"
Set MyTdf = MyDB.CreateTableDef(Table)
MyTdf.Connect = "Excel 8.0; database=" & MySpreadsheet
MyTdf.SourceTableName = Table
MyDB.TableDefs.Append MyTdf
(MyDB & MySpreadsheet defined elsewhere)
Has anyone come across this problem before? Any clues at all?
shay
The code works fine except for one field on one worksheet. The first hundred or so values for this field is Text, thereafter it is numeric. After running the VB application, the imported table correctly contains the Text values for the 100 records but then displays "#Num!" instead of the numeric values (the field data type is defined as Text, by the way).
If I open the Access database and manually import the worksheet into a new table, it works fine.
The code I am using to import the data follows:
Dim MyTdf as TableDef, Table as String
Table = "B8 Results"
Set MyTdf = MyDB.CreateTableDef(Table)
MyTdf.Connect = "Excel 8.0; database=" & MySpreadsheet
MyTdf.SourceTableName = Table
MyDB.TableDefs.Append MyTdf
(MyDB & MySpreadsheet defined elsewhere)
Has anyone come across this problem before? Any clues at all?
shay