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

FREE TEXT SEARCH

Status
Not open for further replies.

Kevsim

Instructor
Apr 18, 2000
385
AU
I have a form based on a query. How do I go about setting up a "Free Text" search function for one or more fields on the form. I would require to view all results of the search. I would appreciate any assistance.
kevsim
 
Hi

Would the SQL like opertaor be adequate for your needs?

You can use wild cards, so you can search for things like *book* which will find and row with the word book in the relevant column.

You can also use ? to represent single character wild cards.

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Thank you for the info, much appreciated, however, I can do the query from a query within the query. My problem is, how can I do it from a Form. What type of control do I use to ask the query, how do I ask the query and how do I have the display simular to a Web Query with multiple choices of selection.
Is it done with SEQ or VD?
I would appreciate how the structure and query should be formed.
kevsim

 
Hi

I am not sure how much detail you need since I do not know your level of expertise.

Say your form is based on a query "SELECT * FROM tblYourTable", and you a text box on your form to accept a search value, then in code you can build an SQL string (say "SELECT * FROM tblYourTable WHERE MyCol Like '*" & txtSearch & "*';" , then set the recordsourec of the form to teh sql string Me.Recordsource = strSQL, and requery the form Me.Requery, will populate your form with only those record(s) matching the WHERE clause.

Does that put you on track?

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
KenReay, thank you for the info, I am still a little lost on setting up the controls and code, I may not have explained fully, the full explanation is as follows -
I have a form based on a query. At present I search for records using 4 combo boxes, I select data in the first box, from my selection in this box only relevant data appears in the second combo box, from the selection in the second combo box only relevant data appears in the third combo box, when I make a selection from the fourth combo box, the complete record appears on my form filling all controls. How do I go about setting up a "Free Text" search function to achieve the same thing for one or more fields on the form and finish with the complete record? Do I need a combo box to select the field I require to search, if so, what code goes in the box for selecting the field? How does this choose only records relevant to the search? I would require to view all results of the search and what controls are necessary and the coding required. Would I need forward and backward buttons? When I am completed with the search how do I leave the query. I would appreciate any advise.
kevsim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top