Hi!
I have a search text box where I want the user to type in something, and when the record is retrieved it is displayed in the dbgrid.
please help me!
Printable View
Hi!
I have a search text box where I want the user to type in something, and when the record is retrieved it is displayed in the dbgrid.
please help me!
The quickest way is with the data control and the DBGrid.
Private Sub cmdFind_Click()
Dim sql As String
sql = "Select * From TableName Where TableNo Like'*" & txtFind.Text & "*'"
Data1.DatabaseName = (App.Path & "\dbname.mdb")
If txtFind = "" Then
Data1.RecordSource = "Select * From TableName"
Else
Data1.RecordSource = sql
End If
Data1.Refresh
End Sub