Text Box linked to a Query criteria

BWG3

Registered User.
Local time
Today, 01:37
Joined
Sep 22, 2009
Messages
44
If this has already been asked, please point me in the right direction. Couldn't find anything related to this when using the search.

I have simple form with a text box and a button labeled "search". Text box is called Search_Box and the form is called frmSearch. I want to have the ability to type in a word into this text box and have this specific text input be the criteria for a column in a query. The column is "Title". When I click on the "search" button, I want the query to run and output into a report only the information associated with the titles that met the criteria of the text box. Basically filiter data. I'm having trouble getting the word in the text box to input correctly into the criteria of the title column. Not sure if I'm using the right criteria code or if something is wrong with how I have the table set up that my main form is inputting into.

The criteria code is [Forms]![frmSearch]![Search_Box] and the data type of the title box is "memo".

I have the queries working fine with a combobox and dates to filter my data, but I am having trouble with text. Can anyone please help me. Thanks in advance.
 
With that criteria, it would require that the search criteria is EXACTLY what is in the Memo field. Are you trying to allow part of the memo field to be searched on? You'll have to modify the code slightly for that, especially when you start dealing with multiple words.

Check this out (This is taking me waaaaay back to when I was a noob lol):

http://access-programmers.co.uk/forums/showthread.php?t=45053&highlight=search
 
Yeah, I guess I'm pretty much a noob. I was definately unaware that I would need to type in exactly what was in the title field. I am just trying to allow part of the memo field to be searched on. Still pretty clueless on how to get his accomplished with lack of vba or access knowledge.
 
Yeah, I guess I'm pretty much a noob. I was definately unaware that I would need to type in exactly what was in the title field. I am just trying to allow part of the memo field to be searched on. Still pretty clueless on how to get his accomplished with lack of vba or access knowledge.

Check out the attachment in the thread I posted above. That's the BEST search form I have ever found and should help lead you in the right direction. It's going to take some research to make it work right for you though as it creates a query and attaches that query to the subform.
 
If they will only enter one word (or a group of words that matches directly with the memo), then you could try something like this:

Like "*" & [Forms]![frmSearch]![Search_Box] & "*"

But I'd recommend at least having a look at the attachment above. It was a good learning experience for me and could be for you too.
 

Users who are viewing this thread

Back
Top Bottom