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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find record in table based on last and first name

Status
Not open for further replies.

jmorlock

Programmer
Apr 25, 2003
46
US
What would be the best method for searching through a client table. I want to find a record matching lastname and firstname. I have it using a loop right now goign through the whole table. But it takes a long time to run. Can you use a seek or search function to find a record with matching first and last name??
 
Use a query - it'll be faster

Select FirstName, LastName from MyTable
where FirstName = '" & MyFirstNameVariable & "'"
and LastName = '" & MYLastNameVariaible & "'"

more or less..

It also might help if you index the two fields. The problem comes in if you are searching for an EXACT match or not...

Is "Ben Hur" the same guy as "Benjamin Hur" ???





Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top