hi. HAPPY NEW YEAR! :) I'm making a system that uses ms access2003 and vb6. My problem is how to search the database with two field names (namely: Lastname, Firstname) and yet I can still search them one by one.
Ex. the Lastname field = "Smith" while the Firstname field = "Jane". when I input the lastname "Smith" in the textbox the datagrid will display all the Smith, and if I add the word "Jane" in the textbox the datagrid will display all the names that has Smith Jane or Jane Smith.
Did you get my point?
Well here is the code that I made. It has a lot of errors that's why I ask you guys anyway.
Private Sub txtsearch_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Set RS = New Recordset Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= I:\system\Records.mdb;Persist Security Info=False" Adodc1.RecordSource = "select * from tblrecords where Lastname, Firstname like '" & txtsearch.Text & "'" Set DataGrid1.DataSource = Adodc1 DataGrid1.Refresh End If End If End Sub
Thank you and I hope you can help me. :)