How to search wisely in a recordset

  • Thread starter Thread starter zhead
  • Start date Start date
Z

zhead

Guest
How can I use the FindFirst/Next recordset methods to find the fields STARTING with a string?

I mean, when I use ">=" criteria it finds the lexicographicly larger values, on which I operate a function that checks if starting with... This causes me a lot of wasted function calls...
Is there a more suitable operator?

10x (Ziev Weinstein)
 
You can use the 'like' operator, e.g.

strCriteria = "[MyField] Like " & Chr(34) & "AAA*" & Chr(34)
MyRecordset.FindFirst strCriteria

This example looks in the field [MyField] for any values that begin with "AAA".

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom