Find an exact match

Ok, maybe that wouldn't be enough for all that. The way to get around the limit is to put the condition in VBA code where according to https://msdn.microsoft.com/en-us/library/office/ff197651.aspx the limit is 32,768 characters. In that case you would change the button to run VBA. The on click event code of the button to apply the filter you have so far the code would be

Code:
DoCmd.ApplyFilter , "[ID] = IIf(IsNumeric([Forms]![SearchF]![txt1]), [Forms]![SearchF]![txt1], Null) Or [CustName] Like ""*"" & [Forms]![SearchF]![txt1] & ""*"""

Note that the where condition here is in double quotes so now wherever there was a double quote before they have been replaced by two double quotes.

What's wrong with the find record method I told you about? Just add a button to the form, in the Command Button Wizard, choose Category Record Navigation and Action: FindRecord. When you click the button you get a pop up (See attached Screen Shot) that does what I think you want.

Hey Buddy thanks for your time on replying..
I did exactly what you told me.. Add a button for search ID and Date and another button for Other entries.. That seems to be working fine..
I just wanted to eliminate two buttons, I wanted to have only one.. but for the time being I think Two is fine..
 
Hi
How do I improve following to get records selected correctly? It worked fine until we had apx 9000 records, but lately it is acting wired on names starting with similar characters.

Like [forms]![frmPackaging]![SelectStu] & "*" And Like [forms]![frmPackaging]![SelectStuID] & "*"
 
Hi
How do I improve following to get records selected correctly? It worked fine until we had apx 9000 records, but lately it is acting wired on names starting with similar characters.

Like [forms]![frmPackaging]![SelectStu] & "*" And Like [forms]![frmPackaging]![SelectStuID] & "*"
I think you would be better off starting a new thread (this one is five years old!), with some examples of what you are trying to look for and what search terms you are entering that aren't working.

Also, what is the exact search term, we can only see the criteria at the moment.
 
Like [forms]![frmPackaging]![SelectStu] & "*" And Like [forms]![frmPackaging]![SelectStuID] & "*"
your Criteria is Incomplete.
must be:

[field1] Like ... And [anotherField] Like ...
 

Users who are viewing this thread

Back
Top Bottom