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

Search memo field for key words

Status
Not open for further replies.

dar149

MIS
Mar 5, 2002
117
US
I have a form with a filter. The user can select a group and a category. Once I have applied the filter, they want to search the question field (which is a memo field)for specific words and bring up only records that are in the specific group and category, with the key words in the memo field. Does anyone know how to do that?

Thanks...
 
Base the form that returns the records on a query. In the Criteria of the memo field, you would have something like:

LIKE "'*"+Forms!Form1!GroupTextbox+"*'" OR LIKE "'*"+Forms!Form1!CategoryTextbox+"*'"

Change OR to AND if both values have to be present.

 
Thanks... That worked great. Now I want a button that will requery so they can select a different group and category. I can get the query to rerun so they can select new groups, but the result is returned a query datasheet, not in the form view. I tried running the query and then opening the form, but the requery still gives me the datasheet view.

I thought I could have the button close the form. But I don't want them to have to reopen the form every time they want to change criteria.

Thanks for any help...
 
Is your requery like this ?
Me.ReQuery

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Usually one creates a form whose recordsource is the query your currently using to return a table. Use the Form Wizard to create the form and it will set all the recordsource stuff up for you. On that form, place the text boxes that contain the typed in values, or put a command button in that pops up the form you are currently using for the typed in values. After the user is thru entering data, set up a command button for them to push. In the click event of the command button, put:

Forms!frmWhatEverTheFormIsThatDisplaysResults.requery
 
Thanks for the information. I was requerying the query instead of the form!

Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top