Error 3709 - The search key was not found in any record

thescottsman

Registered User.
Local time
Today, 06:51
Joined
Sep 18, 2014
Messages
42
Hi All,

I do not understand why this is not working.

I have a Parent Form that has subforms. On the parent form I have two search fields that represent different forms.

The first filter works correctly. However the second does not work and I am getting the run time error.

The code is:
Code:
Me.NavigationSubformContract.Form.Filter = "[QuoteNumber]='" & Me.txtPOSearch & "' "
Me.NavigationSubformContract.Form.FilterOn = True

Like I said im not sure why it is not working. The first search field is a text field, however the second search field (the one that isn't working) is a combobox. This may affect it.

Can anyone help?
 
Hi,

Couple of possibilities spring to mind.
1, is QuoteNumber text or number (if number you do not need the ' ' )
2, You have a space after the last quote mark & "' " should be & "'"
 
Hi Thanks for your response.

This has not worked. I have tried them both separately and together.

Any other ideas?
 
Can you post up the code of both searches and indicate the failing one, I'm assuming you are showing us the one that doesn't work...
 
This is the code that works and filters onto my subforms correctly:
Code:
Me.NavigationSubformContract.Form.Filter = "[Contract]='" & Me.txtcontractsearch.Value & "' "
Me.NavigationSubformContract.Form.FilterOn = True

This is the code that doesn't work correctly:
Code:
Me.NavigationSubformContract.Form.Filter = "[QuoteNumber]= '" & Me.txtPOSearch & "'"
Me.NavigationSubformContract.Form.FilterOn = True
 
Okay - add a debug.print me.txtPOSearch to your code before you set the filter and see what values it gives you.
And as Isskint suggested the way you are looking is that [QuoteNumber] is a text field not a number correct?
 
1. what is the rowsource to your combo?
2. you say you get a runtime error - what is it? description and number required - Edit: sorry just realised it is in your thread heading - so is it still the same error?
3. if not the error - what does 'This has not worked' mean?
 
Last edited:
researching the error description

1. error seems to occur with JET, not ACE - so which version of access are you using? (2003 and earlier is JET)
2. error occurs when importing from Excel
3. error can occur if there is an initial space in a column heading
4. error can occur if db at 2Gb limit (so try compact and repair)
5. there is corrupted data in table
 
"searchkey not found in any record" often relates to corruption

Check the table by inspection - see if you have any "Chinese" characters - it's one good indication of corruption
 

Users who are viewing this thread

Back
Top Bottom