how to search in datagrid where every keyword you type wil display the record
found in database?
You want to search in datagrid or search record in database?
Jx_Man
Senior Poster
3,529 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 516
Skill Endorsements: 64
Ok. So when you type on textbox then there are data display on datagrid.
Use textbox change event to make searching every you type a word on textbox.
This is an example of searching using datagrid. Modified as you needed.
Private Sub Text1_Change()
Set rs = New ADODB.Recordset
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Open "SELECT * FROM Login where fname like " & "'%" & Text1.Text & "%'", Conn, , , adCmdText
Set DataGrid1.DataSource = rs
DataGrid1.Columns(0).Width = 2000
DataGrid1.Columns(1).Width = 2000
DataGrid1.AllowAddNew = False
DataGrid1.AllowArrows = True
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub
Jx_Man
Senior Poster
3,529 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 516
Skill Endorsements: 64
You're welcome.
Don't forget to mark this thread as Solved.
Happy Coding.
Jx_Man
Senior Poster
3,529 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 516
Skill Endorsements: 64
Question Answered as of 5 Months Ago by
Jx_Man
and
deepakbshitole