knarlyd@hotmail.com
Registered User.
- Local time
- Today, 09:49
- Joined
- Sep 6, 2013
- Messages
- 43
I have an Excel spreadsheet that doesn't have any type of index, so I add one after the import. I don't understand why Import routine #1 doesn't bring in *all* the data, only some of it. I looked over the spreadsheet dozens of times but can't see why (I'd include it but it's confidential data.)
If however, issue method #2, all the data is imported, however it deletes the table, then performs the import.
I prefer #1 as it doesn't delete the table contents which include the index.
Here are the two import routines (hopefully someone can tell me why #1 doesn't pull same results
?)
#1:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblprivate", "c:\spreadsheet.xls", True
#2
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="Import", _
filename:=strPathFile, _
HasFieldNames:=True, _
Range:=strRange
db.TableDefs.Refresh
db.Close: Set db = Nothing
If however, issue method #2, all the data is imported, however it deletes the table, then performs the import.
I prefer #1 as it doesn't delete the table contents which include the index.
Here are the two import routines (hopefully someone can tell me why #1 doesn't pull same results
#1:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblprivate", "c:\spreadsheet.xls", True
#2
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="Import", _
filename:=strPathFile, _
HasFieldNames:=True, _
Range:=strRange
db.TableDefs.Refresh
db.Close: Set db = Nothing