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

Simple Text Search

Status
Not open for further replies.

dustinros

IS-IT--Management
Feb 7, 2005
12
US
I'm trying to put together a simple inventory database - the one table has 4 columns, 3 are text, and the primary key is an autonumber that is insignificant to the data.

I need to have a form where you can type in a keyword or part, click a search button, and it searches one column, then returns the row that it is associated with. I've tried reengineering about 8 database/form templates and examples off the web, but none have worked and I can not figure out why!

Any help is greatly appreciated.
 
but none have worked
What have you tried ?
I suggest you to carefully read the 2nd FAQ in my sig.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi, thanks for responding so fast. Um, as for what I've tried, not sure how to explain, since I've downloaded a bunch of different templates off of various sites on the web. The thing is, that I need to be able to search the whole text box, not just the beginning letters. For instance, if I have a text column that says "Resistor, 7.50k", i would need to be able to just type in '7.5', and have that record/row returned. My code is pretty poor, which I guess is why I'm getting hung up and i've just been trying to reengineer stuff...

Any ideas?

Thanks!
 
Have a look at the Like operator:
Like '*' & [keyword] & '*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
YOU ROCK!!!!!! Thanks soooooo much!!! That did it, but now I have one more question if it's not too much trouble. The way it is right now, I am returning one field into an unbound text box, but I need to return another one into another unbound text box. Here's the code for the first return as it is right now:

Private Sub lstTerms_DblClick(Cancel As Integer)
Dim SQL As String

SQL = "Select [ROS_Part#] from [tblParts]" & _
" where [ROS_Part#]= """ & Me.lstTerms & """"

Me.txtDefinition = DLookup("[ROS_Part#]", "tblParts", _
"[Desc]=""" & Me.lstTerms & """")

Me.txtDefinition.SetFocus
End Sub
_______

How would I create a second one of these... txtDefinition2...? Probably a stupid guess. =)

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top