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

Search button

Status
Not open for further replies.

rhonda11

Technical User
Nov 4, 2002
96
US
Just an general question, I also wanted to create a search form. Whereas you have a text field and a search button that can search for keywords or partial word base on what you entered in the text field. Then, the result would either found an exact match and bring up that record or could be more. Can access do that? How, can somebody show me.

Thanks in advance.
 
Hi,

It sure can. You have several options also. The easiest way would be to create a select query that references the table that you are searching in. In the field that you wish to search just type in the Criterial Field this:

[Enter Text To Search For]

Set this query to the Record Source of the form. Wallah - when the form is opened a message box will pop up and if the record is found it will then open the form with your record displayed. Then all you have to do is create a button and have it open the form. - However, it does have some draw backs: this will only search one field and I think that it will only handle complete keywords...

You can also try the DLookup function and set it's returned value as a bookmark and requery your form based on the bookmark value. But, there are plenty of ways to skin a cat....

jbehrne
 
Thanks for your respond but I understand the parameter. However, what if you what to customized your own search form. Let say, I pull the form with the customer record but I would like to create another text field and a search button within the same form incase I what to retrieve another customer and that customer would display on the current form. And of course I would like to be able to search partial word instead of exact name of the field (kind of like a search browser)

Thanks again

 
You can use the DLookup function (see Access VB Help for more info), or the Find Method (ADO) . The DLookup will search a particular field for the value and you can use the bookmark function (see Access VB Help for more info) to requery your form based on its result. That being said, and I don't know if you want to avoid it or not, but the canned Access search wizard seems to do the job for me. It also allows for partial searches and it will allow you to search in anyfield.

jbehrne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top