ADO: .Find How to use the like operator correct?
Hi,
I use rst.Find to find records, but need to use the like operator.
And I need to use parameters for the fieldnames and searchstrings.
Anybody can give me a working example?
This doesn't work:
strFiendField = "CNR"
strSearchString = 100
varReturn = rsCustomer.Find(strFindField & " = " & Trim(strSearchString), , adSearchForward)
varReturn = rsCustomer.Find(strFindField & " LIKE " & Trim(strSearchString), , adSearchForward)
Franky
H peet and cowboy (John Wayne? hehe)
Ok, I explain what I want to do.
I created a form in which the use can select a field that he want to search, he can select for search backward of forward and to search with the like operator or not. I want to use this parameters then to create the .find
I read in MSDn that it is possible to use .Find with the parameters as I want. Cowboys example works for sure, but how can I search then backwards? The Like Paramater works well if I don't use () for the .Find
Let's give a example:
I want to find Mr. Clinton and Mr. Clanton. I use now Cl?nton and the like, I want to search backwards.
About the question from peet about numeric fields and stringfields I am aware of it and will use it as needed.
I am happy that you try to help me, but it seems that until now nobody here used parameters for the ADO.find
If we find a solution for it then I will post the form here (because it is a very nice form) including the code, so that everybody can use a selfcreated .find
Thanks again and I wait for replys, hehe
Franky
Hi peet and cowboy ... and whoever can help!!!
I changed the way to the way that you showed here, cowboy.
The Find = is absolutly under control now. it workse perfect. What is still a problem is the LIKE. How to get a result with the like operator?
Franky