Does anyone have an idea how to use the FindFirst method of a DAO recordset to find a record where the specified field contains the desired string (not necessarily the entire field contents)?
Bruce,<br>It's the same as SQL, use the LIKE operator, ie:<br>dim strCriteria as string<br>strCriteria = "Some string probably from a textbox"<br>Recordset.Findfirst "Lastname LIKE ""*" & strCriteria & "*"""<br><br>--Jim
Bruce:<br><br> The wildcard character is no longer a * (star), Microsoft changed it in their new engine to be a % percent sign.<br><br>Renae
BitCounter,<br>Which Engine changed to % instead of *? Not JET 4...maybe that 'in between' engine (msde or some odd name) , and SQL server always used % (as far as I remember), as do most (if not all) Server Dbms'. If JET has a newer version, I've not seen it yet, but I'd guess JET, being on the way out, probably wouldn't change something like that at this stage in the game.<br>--Jim
Our standards call for all of our application executables to run without alteration with either Jet or SQL Server (or MSDE version of SQL Server). All versions of Jet that we have encountered use the * for the “whatever” code. SQL Server uses % for the same purpose. I don’t know of any changes to those conventions. <p>John Kisner<br><a href=mailto:jlkisner@jlkisner.com>jlkisner@jlkisner.com</a><br><a href= > </a><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.