after i put earch code in my project :

Private Sub cmdSearch_Click()
Dim search
search = InputBox("please enter card no", , "")
Data1.RecordSource = "SELECT * FROM waqf WHERE cardno LIKE (""" & "*" & search & "*" & """)"
Data1.Refresh
End Sub
-------------
the search working but appear problem that when i click on search buttom he give me the object that iwant then i want back to all data (in dbgrid) in forms i can't only data of search appear that make me close project and start again ,, please help me friends
((if you don't full down you willn't come up)) thank u all

hmmm... Could you post your code? We'll see if we can help.

hmmm... Could you post your code? We'll see if we can help.

this is code(search)
================================================
Private Sub cmdSearch_Click()
Dim search
search = InputBox("please enter card no", , "")
Data1.RecordSource = "SELECT * FROM waqf WHERE cardno LIKE (""" & "*" & search & "*" & """)"
Data1.Refresh
End Sub

=============================================
then my quetion is when i make search in form that data saved on it he give me answer of i search for , then i want back to my form ,only appear the record i search for ,so i want see all data on form after i do search is this possible or not ????? thank u for reply

ok....try this code...
hope this works

Private Sub cmdSearch_Click()
Dim search As String

search = InputBox("Enter card no :", "Filter Data")
[B]Data1.RecordSource = "select * from waqf where cardno like '*" & Trim(search) & "*' order by cardno"[/B]
Data1.Refresh
End Sub

Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\waqf.mdb"
Data1.RecordSource = "waqf"
End Sub

see the Bolded statement. thats your key...

regards
Shouvik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.