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

find records based on partial search criteria 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I want to show a record based on part of a string i.e.when I enter a customer name into a field[Cust_Name]
In the afterupdate I want to use part of the name e.g. "Bloggs" from the entered name "Fred Bloggs widget co." to search for all records with "Bloggs" in it and show each record in turn (like the built-in Access search facility)
if a matching record is found I want to edit this one and undo the previously entered record
Any suggestions would be much appreciated. TIA

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 

Your WHERE clause should look like

WHERE [Cust_Name] Like "*" & txtSearch & "*;"

txtSearch is a textbox on your searching form
 
Many thanks for your quick response!
this is a naive question but can you show me how this is programmed in the afterUpdate event?

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 

On a unbound form, place a text box for the user to enter the search value and name it as txtSearch. Save the form as frmSearch. Create a query from your table to show the fields you need.At the field [Cust_Name] put this to the "Where" line

Like "*" & Forms!frmSearch.txtSearch.Value & "*"

Save the query as qdfSearch. Create a form based on that qdfSearch and save it as frmSearchResults. Open frmSearch in design and drag & drop on it frmSearchResults. On the Change event of the txtSearch put this
Me!frmSearchResults.Requery

I think that 's all
 
Many thanks, you have been a great help, it is much appreciated!

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top