Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindFirst work with partial field contents ? 1

Status
Not open for further replies.

BruceHesher

Programmer
Jul 7, 1999
50
US
  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 = &quot;Some string probably from a textbox&quot;<br>Recordset.Findfirst &quot;Lastname LIKE &quot;&quot;*&quot; & strCriteria & &quot;*&quot;&quot;&quot;<br><br>--Jim
 
Bruce:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 *?&nbsp;&nbsp;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'.&nbsp;&nbsp;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).&nbsp;&nbsp;All versions of Jet that we have encountered use the * for the “whatever” code.&nbsp;&nbsp;SQL Server uses % for the same purpose.&nbsp;&nbsp;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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top