ianverrier
New member
- Local time
- Yesterday, 18:26
- Joined
- Dec 20, 2010
- Messages
- 3
I am trying to import a large spreadsheet into access with the following code:
DoCmd.TransferSpreadsheet acImport, , "import_" & worksheet_list!worksheet, path & "\input_files\" & rnc_list!RNC & ".xls", True, worksheet_list!worksheet & "!A:HA"
But I get this error: search key not found
But it works with the range: A:GV and A:HA so there is nothing wrong with the field names. So I assume it is over the max number of fields.
I need field A and HA in the same table since A is used to identify the record.
To solve this problem I want to import 2 ranges into the same table but I can't figure out the syntax. (eg. A:AG and CA:HA)
I tried
!A:AG,CA:HA
!(A:AG,CA:HA)
If this is not posiible is there another way to import tables with too many field names when the first field need to be present to identy which record the rest of the fields are attached to.
Thanks
Ian
DoCmd.TransferSpreadsheet acImport, , "import_" & worksheet_list!worksheet, path & "\input_files\" & rnc_list!RNC & ".xls", True, worksheet_list!worksheet & "!A:HA"
But I get this error: search key not found
But it works with the range: A:GV and A:HA so there is nothing wrong with the field names. So I assume it is over the max number of fields.
I need field A and HA in the same table since A is used to identify the record.
To solve this problem I want to import 2 ranges into the same table but I can't figure out the syntax. (eg. A:AG and CA:HA)
I tried
!A:AG,CA:HA
!(A:AG,CA:HA)
If this is not posiible is there another way to import tables with too many field names when the first field need to be present to identy which record the rest of the fields are attached to.
Thanks
Ian