The search Key was not found in any record

kevinh2320

Board Regular
Joined
May 13, 2016
Messages
61
I'm getting the "The search Key was not found in any record" error when trying to run delete queries in my MS Access database. I'm importing data from an Excel file using the following code:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "TestTempTbl", _
"C:\Users\UserTest\Documents\MSAccessDatabases\Contracts\Data\ContractData\FY2021ContractsLog.xlsx", False

Any suggestions on how to correct this?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Your post is not clear. Are you getting the error when running delete query in Access, or when trying to import? If the latter, make sure no spreadsheet column headers begin with a space, assuming you're using first row as headers.
 
Upvote 0
It was while running a delete query. There was a space in the beginning of one of the headers. Thanks for the solution.
 
Upvote 0
You're welcome, although I think it was a joint effort!
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top