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!

search problem

Status
Not open for further replies.

HansD

Programmer
Feb 12, 2002
60
NL
please help me. I've been trying to solve this for days now and I can't.
I have a table with adresses (adressen) in there there are name, address, street, phonenumber, etc. In my form (form1) i've made a text box and a button. when i put for example: AN in the textbox it must search the entier table (adressen) for results and put it in a second form. So it must find for example: the name hANs and from another record for example the street hANnoverstreet, etc. and put these 2 record in another form.
Is threre anybody who understands my question and can help me
TNX
 
Let's assume we have a form (Form1) that is bound to a table (Table1). In the Form Header put a textbox (txtSearch) and a command button (cmdSearch).

To show all entries in the table where addressn contains the text typed in txtSearch, use this code in the cmdSearch_Click() event method:

Private Sub cmdSearch_Click()

Me.RecordSource = "select * from Table1 where addressn like '*" & txtSearch & "*'"
Me.Requery

End Sub

 
Oke tnx man , I am going to try that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top